feat: add new account management

This commit is contained in:
reya
2024-02-08 17:17:45 +07:00
parent d7bbda6e7b
commit 17052aeeaa
35 changed files with 1140 additions and 1484 deletions
+3 -6
View File
@@ -1,18 +1,15 @@
import { locale, platform } from "@tauri-apps/plugin-os";
import Database from "@tauri-apps/plugin-sql";
import { Store } from "@tauri-apps/plugin-store";
import { PropsWithChildren, createContext, useContext } from "react";
import { LumeStorage } from "./storage";
const StorageContext = createContext<LumeStorage>(null);
const sqliteAdapter = await Database.load("sqlite:lume_v3.db");
const store = new Store("lume.data");
const platformName = await platform();
const osLocale = await locale();
const db = new LumeStorage(sqliteAdapter, platformName, osLocale);
await db.init();
if (db.settings.depot) await db.launchDepot();
const db = new LumeStorage(store, platformName, osLocale);
export const StorageProvider = ({ children }: PropsWithChildren<object>) => {
return (