data sync

This commit is contained in:
Gabe Yuan
2023-07-31 03:10:09 +08:00
parent 497084fe8a
commit 2aef159d9d
12 changed files with 14333 additions and 9971 deletions

View File

@@ -1,3 +1,4 @@
import { useCallback } from "react";
import { STOKEY_SETTING } from "../config";
import storage from "../libs/storage";
import { useStorages } from "./Storage";
@@ -16,7 +17,7 @@ export function useSetting() {
* @returns
*/
export function useSettingUpdate() {
return async (obj) => {
await storage.putObj(STOKEY_SETTING, obj);
};
return useCallback(async (obj) => {
await storage.putObj(STOKEY_SETTING, { ...obj, updateAt: Date.now() });
}, []);
}