chore(app): cleanup main files

This commit is contained in:
DanCodes committed 2024-01-09 13:18:54 +00:00
1 parent 5bb89c1b08
commit d3b367b948
15 files changed
+427 -408

No files matched your search

+5 -3
View File
@@ -1,6 +1,6 @@
import { appLocalDataDir, join } from "@tauri-apps/api/path";
import { Store } from "tauri-plugin-store-api";
// TODO: Add encryption to user data
export interface UserStore {
user: {
Name: string;
@@ -8,7 +8,8 @@ export interface UserStore {
};
}
const user = new Store(".user.dat");
const base = await appLocalDataDir();
const user = new Store(await join(base, ".user.dat"));
/**
* Set User details to .user.dat
@@ -16,8 +17,9 @@ const user = new Store(".user.dat");
const saveUser = async (userName: string, userPassword?: string) => {
user.set("user", {
Name: userName,
Password: userPassword || "",
Password: userPassword,
});
await user.save();
};