@tblabs/storage 5.2.3 → 5.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/OnlineStorage.d.ts +1 -1
- package/OnlineStorage.js +3 -2
- package/package.json +1 -1
- package/tblabs-storage-5.2.5.tgz +0 -0
- package/tblabs-storage-5.2.3.tgz +0 -0
package/OnlineStorage.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare class OnlineStorage {
|
|
|
20
20
|
get User(): IStorageUser;
|
|
21
21
|
Login(password: string): Promise<IStorageUser>;
|
|
22
22
|
private SaveUserInLocalStorage;
|
|
23
|
-
OnUserChange(handler: (user: IStorageUser) => void): this;
|
|
23
|
+
OnUserChange(handler: (user: IStorageUser, isAuthorized: boolean) => void): this;
|
|
24
24
|
Register(id: string, role: string, name: string, password: string, privileges: IStorageUserPrivileges, icon?: string, tags?: string[]): Promise<IStorageUser>;
|
|
25
25
|
Logout(): this;
|
|
26
26
|
private CallOnUserChanged;
|
package/OnlineStorage.js
CHANGED
|
@@ -54,6 +54,7 @@ export class OnlineStorage {
|
|
|
54
54
|
}
|
|
55
55
|
OnUserChange(handler) {
|
|
56
56
|
this.onUserChange.push(handler);
|
|
57
|
+
handler(this.user, this.IsAuthorized);
|
|
57
58
|
return this;
|
|
58
59
|
}
|
|
59
60
|
async Register(id, role, name, password, privileges, icon, tags) {
|
|
@@ -71,7 +72,7 @@ export class OnlineStorage {
|
|
|
71
72
|
return this;
|
|
72
73
|
}
|
|
73
74
|
CallOnUserChanged() {
|
|
74
|
-
this.onUserChange.forEach(handler => handler(this.user));
|
|
75
|
+
this.onUserChange.forEach(handler => handler(this.user, this.IsAuthorized));
|
|
75
76
|
}
|
|
76
77
|
get IsAuthorized() {
|
|
77
78
|
return this.user.Id !== this.ANONYMOUS_USER.Id;
|
|
@@ -91,7 +92,7 @@ export class OnlineStorage {
|
|
|
91
92
|
}
|
|
92
93
|
Log(...message) {
|
|
93
94
|
if (this.logEnabled) {
|
|
94
|
-
console.log('[
|
|
95
|
+
console.log('[OnlineStorage]', ...message);
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
async Ping() {
|
package/package.json
CHANGED
|
Binary file
|
package/tblabs-storage-5.2.3.tgz
DELETED
|
Binary file
|