mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-19 17:10:27 +01:00
add wallpaper
This commit is contained in:
parent
532a2f049f
commit
3d4c09510b
1 changed files with 12 additions and 0 deletions
|
@ -54,6 +54,7 @@ type Registry = {
|
||||||
coldDeviceStorage: Partial<typeof ColdDeviceStorage.default>;
|
coldDeviceStorage: Partial<typeof ColdDeviceStorage.default>;
|
||||||
fontSize: string | null;
|
fontSize: string | null;
|
||||||
useSystemFont: 't' | null;
|
useSystemFont: 't' | null;
|
||||||
|
wallpaper: string | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
type Registries = {
|
type Registries = {
|
||||||
|
@ -99,6 +100,7 @@ async function saveNew() {
|
||||||
coldDeviceStorage: ColdDeviceStorage.getAll(),
|
coldDeviceStorage: ColdDeviceStorage.getAll(),
|
||||||
fontSize: localStorage.getItem('fontSize'),
|
fontSize: localStorage.getItem('fontSize'),
|
||||||
useSystemFont: localStorage.getItem('useSystemFont') as 't' | null,
|
useSystemFont: localStorage.getItem('useSystemFont') as 't' | null,
|
||||||
|
wallpaper: localStorage.getItem('wallpaper'),
|
||||||
};
|
};
|
||||||
await os.api('i/registry/set', { scope, key: id, value: registry });
|
await os.api('i/registry/set', { scope, key: id, value: registry });
|
||||||
registries[id] = registry;
|
registries[id] = registry;
|
||||||
|
@ -142,6 +144,13 @@ async function applyRegistry(id: string) {
|
||||||
localStorage.removeItem('useSystemFont');
|
localStorage.removeItem('useSystemFont');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// wallpaper
|
||||||
|
if (registry.wallpaper != null) {
|
||||||
|
localStorage.setItem('wallpaper', registry.wallpaper);
|
||||||
|
} else {
|
||||||
|
localStorage.removeItem('wallpaper');
|
||||||
|
}
|
||||||
|
|
||||||
const { canceled: cancel2 } = await os.confirm({
|
const { canceled: cancel2 } = await os.confirm({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
text: ts.reloadToApplySetting,
|
text: ts.reloadToApplySetting,
|
||||||
|
@ -183,6 +192,9 @@ async function save(id: string) {
|
||||||
updatedAt: (new Date()).toISOString(),
|
updatedAt: (new Date()).toISOString(),
|
||||||
defaultStore: getDefaultStoreValues(),
|
defaultStore: getDefaultStoreValues(),
|
||||||
coldDeviceStorage: ColdDeviceStorage.getAll(),
|
coldDeviceStorage: ColdDeviceStorage.getAll(),
|
||||||
|
fontSize: localStorage.getItem('fontSize'),
|
||||||
|
useSystemFont: localStorage.getItem('useSystemFont') as 't' | null,
|
||||||
|
wallpaper: localStorage.getItem('wallpaper'),
|
||||||
};
|
};
|
||||||
await os.api('i/registry/set', { scope, key: id, value: registry });
|
await os.api('i/registry/set', { scope, key: id, value: registry });
|
||||||
registries[id] = registry;
|
registries[id] = registry;
|
||||||
|
|
Loading…
Reference in a new issue