1
0
mirror of https://github.com/koloml/philomena-tagging-assistant.git synced 2026-05-09 23:22:20 +00:00

Added the store for dynamically changing the popup titles

This commit is contained in:
2026-01-09 05:27:48 +04:00
parent 5fd6dee999
commit 70129d7a0e
2 changed files with 20 additions and 0 deletions

15
src/stores/popup.ts Normal file
View File

@@ -0,0 +1,15 @@
import { derived, writable } from "svelte/store";
import { PLUGIN_NAME } from "$lib/constants";
/**
* Store containing the name of the subpage. This name will be added to the title alongside the name of the plugin.
*/
export const popupTitle = writable<string | null>(null);
/**
* Name of the current route with the name of the plugin appended to it.
*/
export const headTitle = derived(
popupTitle,
$popupTitle => ($popupTitle ? `${$popupTitle} | ` : '') + PLUGIN_NAME
);