@subiz/widget-v4 4.1.21 → 4.1.24
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/compiled_src/store/api_fake.js +10 -2
- package/compiled_src/store/store.js +20 -4
- package/dist/{186965b8487.app.js → 186a09be422.app.js} +1 -1
- package/dist/{186965b8487.index.html → 186a09be422.index.html} +1 -1
- package/dist/{186965b8487.library.html → 186a09be422.library.html} +1 -1
- package/dist/{186965b8487.library.js → 186a09be422.library.js} +1 -1
- package/dist/{186965b8487.preview.html → 186a09be422.preview.html} +1 -1
- package/dist/{186965b8487.preview.js → 186a09be422.preview.js} +1 -1
- package/dist/{186965b8487.screenshoot.js → 186a09be422.screenshoot.js} +1 -1
- package/dist/{186965b8487.webview.js → 186a09be422.webview.js} +1 -1
- package/dist/HASH +1 -1
- package/dist/screenshoot.html +1 -1
- package/dist/screenshoot.js +20 -3
- package/package.json +1 -1
- package/src/store/api_fake.js +23 -2
- package/src/store/store.js +27 -2
- /package/dist/{186965b8487.132.js → 186a09be422.132.js} +0 -0
- /package/dist/{186965b8487.178.js → 186a09be422.178.js} +0 -0
- /package/dist/{186965b8487.213.js → 186a09be422.213.js} +0 -0
- /package/dist/{186965b8487.335.js → 186a09be422.335.js} +0 -0
- /package/dist/{186965b8487.362.js → 186a09be422.362.js} +0 -0
- /package/dist/{186965b8487.441.js → 186a09be422.441.js} +0 -0
- /package/dist/{186965b8487.605.js → 186a09be422.605.js} +0 -0
- /package/dist/{186965b8487.678.js → 186a09be422.678.js} +0 -0
- /package/dist/{186965b8487.782.js → 186a09be422.782.js} +0 -0
|
@@ -66,7 +66,11 @@ class _default {
|
|
|
66
66
|
_defineProperty(this, "getUser", _ => Promise.resolve({
|
|
67
67
|
code: 200,
|
|
68
68
|
body: {
|
|
69
|
-
id: '
|
|
69
|
+
id: 'usqzgtgfake',
|
|
70
|
+
attributes: [{
|
|
71
|
+
key: 'fullname',
|
|
72
|
+
text: 'Kiều Thanh'
|
|
73
|
+
}]
|
|
70
74
|
}
|
|
71
75
|
}));
|
|
72
76
|
_defineProperty(this, "getAccountSetting", () => this.apireq.get(`/accounts/${this.accid}/settings`));
|
|
@@ -85,7 +89,11 @@ class _default {
|
|
|
85
89
|
this.uid = obj.uid;
|
|
86
90
|
return {
|
|
87
91
|
account_id: this.accid,
|
|
88
|
-
id: 'usqzgtgfake'
|
|
92
|
+
id: 'usqzgtgfake',
|
|
93
|
+
attributes: [{
|
|
94
|
+
key: 'fullname',
|
|
95
|
+
text: 'Kiều Thanh'
|
|
96
|
+
}]
|
|
89
97
|
};
|
|
90
98
|
}
|
|
91
99
|
}
|
|
@@ -78,7 +78,6 @@ class Store {
|
|
|
78
78
|
_defineProperty(this, "list_provinces", () => this.api.list_provinces());
|
|
79
79
|
_defineProperty(this, "list_districts", p => this.api.list_districts(p));
|
|
80
80
|
_defineProperty(this, "list_wards", p => this.api.list_wards(p));
|
|
81
|
-
_defineProperty(this, "list_provices", void 0);
|
|
82
81
|
_defineProperty(this, "listEvents", id => {
|
|
83
82
|
if (!id || id === '*' || typeof id !== 'string') return;
|
|
84
83
|
if (!this.isInsync('events' + id)) {
|
|
@@ -325,9 +324,6 @@ class Store {
|
|
|
325
324
|
async init(accid, mask, userRef) {
|
|
326
325
|
this.readyGate.close();
|
|
327
326
|
accid = (accid || '').trim();
|
|
328
|
-
this.api.setAuth({
|
|
329
|
-
accid: accid
|
|
330
|
-
});
|
|
331
327
|
this.g_sync = {};
|
|
332
328
|
if (!userRef) {
|
|
333
329
|
try {
|
|
@@ -353,6 +349,12 @@ class Store {
|
|
|
353
349
|
}
|
|
354
350
|
}
|
|
355
351
|
}
|
|
352
|
+
if (this.cookie.get('__sbref', userRef) != userRef) {
|
|
353
|
+
cleanMyLocalStorage();
|
|
354
|
+
}
|
|
355
|
+
this.api.setAuth({
|
|
356
|
+
accid: accid
|
|
357
|
+
});
|
|
356
358
|
if (userRef) this.cookie.set('__sbref', userRef);
|
|
357
359
|
let user = await this.api.setAuth({
|
|
358
360
|
accid: accid,
|
|
@@ -1060,4 +1062,18 @@ let cleanLocalStorage = () => {
|
|
|
1060
1062
|
}
|
|
1061
1063
|
}
|
|
1062
1064
|
});
|
|
1065
|
+
};
|
|
1066
|
+
let cleanMyLocalStorage = () => {
|
|
1067
|
+
try {
|
|
1068
|
+
localStorage;
|
|
1069
|
+
} catch (e) {
|
|
1070
|
+
return;
|
|
1071
|
+
}
|
|
1072
|
+
_index.default.setTimeout(() => {
|
|
1073
|
+
for (var key in localStorage) {
|
|
1074
|
+
if (key && (key.startsWith('cbz2020') || key.startsWith('sbz2020') || key.startsWith('sbz2022') || key.startsWith('sbz2023'))) {
|
|
1075
|
+
localStorage.removeItem(key);
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
});
|
|
1063
1079
|
};
|