@@ -36,14 +36,6 @@ export class AccessController {
3636 this . isContainer = targetDoc . uri . slice ( - 1 ) === '/' // Give default for all directories
3737 if ( defaultHolder && defaultACLDoc ) {
3838 this . isUsingDefaults = true
39- const defaults = this . store
40- . each ( null , ACL ( 'default' ) , defaultHolder , defaultACLDoc )
41- . concat ( this . store . each ( null , ACL ( 'defaultForNew' ) , defaultHolder , defaultACLDoc ) )
42- if ( ! defaults . length ) {
43- this . status . innerText = ' (No defaults given.)'
44- } else {
45- this . status . innerText = ''
46- }
4739 const aclDefaultStore = adoptACLDefault ( this . targetDoc , targetACLDoc , defaultHolder , defaultACLDoc )
4840 this . mainCombo = new AccessGroups ( targetDoc , targetACLDoc , this , aclDefaultStore , { defaults : true } )
4941 this . defaultsCombo = null
@@ -63,16 +55,16 @@ export class AccessController {
6355 public render ( ) : HTMLElement {
6456 this . root . innerHTML = ''
6557 if ( this . isUsingDefaults ) {
66- this . setStatus ( `The sharing for this ${ this . noun } is the default for folder ` )
58+ this . renderStatus ( `The sharing for this ${ this . noun } is the default for folder ` )
6759 if ( this . defaultHolder ) {
6860 const defaultHolderLink = this . status . appendChild ( this . dom . createElement ( 'a' ) )
6961 defaultHolderLink . href = this . defaultHolder . uri
7062 defaultHolderLink . innerText = shortNameForFolder ( this . defaultHolder )
7163 }
7264 } else if ( ! this . defaultsDiffer ) {
73- this . setStatus ( 'This is also the default for things in this folder.' )
65+ this . renderStatus ( 'This is also the default for things in this folder.' )
7466 } else {
75- this . setStatus ( '' )
67+ this . renderStatus ( '' )
7668 }
7769 this . root . appendChild ( this . mainCombo . render ( ) )
7870 if ( this . defaultsCombo && this . defaultsDiffer ) {
@@ -95,7 +87,7 @@ export class AccessController {
9587 useDefaultButton . classList . add ( this . classes . bigButton )
9688 useDefaultButton . addEventListener ( 'click' , ( ) => this . removeAcls ( )
9789 . then ( ( ) => this . render ( ) )
98- . catch ( error => this . setStatus ( error ) ) )
90+ . catch ( error => this . renderStatus ( error ) ) )
9991 return useDefaultButton
10092 }
10193
@@ -105,7 +97,7 @@ export class AccessController {
10597 addAclButton . classList . add ( this . classes . bigButton )
10698 addAclButton . addEventListener ( 'click' , ( ) => this . addAcls ( )
10799 . then ( ( ) => this . render ( ) )
108- . catch ( error => this . setStatus ( error ) ) )
100+ . catch ( error => this . renderStatus ( error ) ) )
109101 return addAclButton
110102 }
111103
@@ -138,7 +130,7 @@ export class AccessController {
138130 button . classList . add ( this . classes . bigButton )
139131 button . addEventListener ( 'click' , ( ) => this . removeDefaults ( )
140132 . then ( ( ) => this . render ( ) )
141- . catch ( error => this . setStatus ( error ) ) )
133+ . catch ( error => this . renderStatus ( error ) ) )
142134 return removeDefaults
143135 }
144136
@@ -155,7 +147,7 @@ export class AccessController {
155147 } , 5000 )
156148 }
157149
158- public setStatus ( message : string ) : void {
150+ public renderStatus ( message : string ) : void {
159151 // @@ TODO Introduce better system for error notification to user https://github.com/solid/mashlib/issues/87
160152 this . status . classList . toggle ( this . classes . aclControlBoxStatusRevealed , ! ! message )
161153 this . status . innerText = message
0 commit comments