@webitel/ui-sdk 24.12.147 → 24.12.149
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/package.json
CHANGED
|
@@ -25,15 +25,25 @@ export const createTablePaginationStore = (namespace: string) => {
|
|
|
25
25
|
next.value = false;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
const setupPersistence =
|
|
28
|
+
const setupPersistence = () => {
|
|
29
29
|
const { restore: restorePage } = usePersistedStorage({
|
|
30
30
|
name: 'page',
|
|
31
31
|
value: page,
|
|
32
|
+
onRestore: async (restore, name) => {
|
|
33
|
+
const value = await restore(name);
|
|
34
|
+
const numValue = +value;
|
|
35
|
+
if (numValue) page.value = numValue;
|
|
36
|
+
},
|
|
32
37
|
});
|
|
33
38
|
|
|
34
39
|
const { restore: restoreSize } = usePersistedStorage({
|
|
35
40
|
name: 'size',
|
|
36
41
|
value: size,
|
|
42
|
+
onRestore: async (restore, name) => {
|
|
43
|
+
const value = await restore(name);
|
|
44
|
+
const numValue = +value;
|
|
45
|
+
if (numValue) size.value = numValue;
|
|
46
|
+
},
|
|
37
47
|
});
|
|
38
48
|
|
|
39
49
|
return Promise.allSettled([restorePage(), restoreSize()]);
|