Replace the leftover 'subfeed' name across logger names + log_config, frontend localStorage keys, Postgres user/db/volume defaults in the compose files, .env.example, config.py, backup/restore scripts and the README. Pure rename; no behavioural change. localStorage keys move from subfeed.* to siftlode.* (one-time UI-state reset is acceptable).
36 lines
909 B
TypeScript
36 lines
909 B
TypeScript
// App-wide "hints" toggle: when on, Tooltip components reveal short explanatory
|
|
// captions on hover so the UI is somewhat self-documenting for new users. Experienced
|
|
// users can turn it off in Settings. Persisted to localStorage (+ server preferences).
|
|
const KEY = "siftlode.hints";
|
|
|
|
let enabled = load();
|
|
let listeners: Array<() => void> = [];
|
|
|
|
function load(): boolean {
|
|
try {
|
|
return localStorage.getItem(KEY) !== "0"; // default ON
|
|
} catch {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
export function hintsEnabled(): boolean {
|
|
return enabled;
|
|
}
|
|
|
|
export function setHintsEnabled(v: boolean): void {
|
|
enabled = v;
|
|
try {
|
|
localStorage.setItem(KEY, v ? "1" : "0");
|
|
} catch {
|
|
/* ignore */
|
|
}
|
|
listeners.forEach((l) => l());
|
|
}
|
|
|
|
export function subscribeHints(listener: () => void): () => void {
|
|
listeners.push(listener);
|
|
return () => {
|
|
listeners = listeners.filter((l) => l !== listener);
|
|
};
|
|
}
|