blob: ce6c344b9cbc3a5a9005daba0f1b9125f7bea586 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
import {getBrowser} from "./main.tsx";
export interface ISettings {
sort: "from-bookmarks" | "alphabetical" | "recent"
foldersFirst: boolean
backgroundMode: "theme" | "color" | "image"
backgroundColor: string
backgroundImage: string
foregroundColor: string
editMode: boolean
rootFolder: string | null
}
export let defaultSettings: ISettings = {
sort: "from-bookmarks",
foldersFirst: true,
backgroundMode: "theme",
backgroundColor: "#000000",
backgroundImage: "",
foregroundColor: "#FFFFFF",
editMode: false,
rootFolder: '0',
}
export function loadSettings(): Promise<ISettings> {
// @ts-ignore
let tmp: Promise<ISettings> = getBrowser().storage.local.get(defaultSettings);
tmp.then(j => console.log(j))
return tmp;
}
export function writeSettings(settings: ISettings) {
getBrowser().storage.local.set(settings);
}
|