mirror of
https://github.com/koloml/philomena-tagging-assistant.git
synced 2026-05-09 15:12:21 +00:00
Moving and renaming entities storages to entities dir
This commit is contained in:
@@ -5,7 +5,7 @@ import MaintenanceSettings from "$lib/extension/settings/MaintenanceSettings";
|
||||
/**
|
||||
* Store for working with maintenance profiles in the Svelte popup.
|
||||
*/
|
||||
export const maintenanceProfilesStore: Writable<MaintenanceProfile[]> = writable([]);
|
||||
export const maintenanceProfiles: Writable<MaintenanceProfile[]> = writable([]);
|
||||
|
||||
/**
|
||||
* Store for the active maintenance profile ID.
|
||||
@@ -22,7 +22,7 @@ let lastActiveProfileId: string|null = null;
|
||||
Promise.allSettled([
|
||||
// Read the initial values from the storages first
|
||||
MaintenanceProfile.readAll().then(profiles => {
|
||||
maintenanceProfilesStore.set(profiles);
|
||||
maintenanceProfiles.set(profiles);
|
||||
}),
|
||||
maintenanceSettings.resolveActiveProfileId().then(activeProfileId => {
|
||||
activeProfileStore.set(activeProfileId);
|
||||
@@ -30,7 +30,7 @@ Promise.allSettled([
|
||||
]).then(() => {
|
||||
// And only after initial values are loaded, start watching for changes from storage and from user's interaction
|
||||
MaintenanceProfile.subscribe(profiles => {
|
||||
maintenanceProfilesStore.set(profiles);
|
||||
maintenanceProfiles.set(profiles);
|
||||
});
|
||||
|
||||
maintenanceSettings.subscribe(settings => {
|
||||
11
src/stores/entities/tag-groups.ts
Normal file
11
src/stores/entities/tag-groups.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { type Writable, writable } from "svelte/store";
|
||||
import TagGroup from "$entities/TagGroup";
|
||||
|
||||
export const tagGroups: Writable<TagGroup[]> = writable([]);
|
||||
|
||||
TagGroup
|
||||
.readAll()
|
||||
.then(groups => tagGroups.set(groups))
|
||||
.then(() => {
|
||||
TagGroup.subscribe(groups => tagGroups.set(groups));
|
||||
});
|
||||
@@ -1,11 +0,0 @@
|
||||
import { type Writable, writable } from "svelte/store";
|
||||
import TagGroup from "$entities/TagGroup";
|
||||
|
||||
export const tagGroupsStore: Writable<TagGroup[]> = writable([]);
|
||||
|
||||
TagGroup
|
||||
.readAll()
|
||||
.then(groups => tagGroupsStore.set(groups))
|
||||
.then(() => {
|
||||
TagGroup.subscribe(groups => tagGroupsStore.set(groups));
|
||||
});
|
||||
Reference in New Issue
Block a user