mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-07 00:13:53 +00:00
17 lines
432 B
TypeScript
17 lines
432 B
TypeScript
import { baseURI } from '../../externals';
|
|
|
|
export function booleanFromLocalStorage(key: string, fallback: boolean): boolean {
|
|
const valueInStorage = localStorage.getItem(key);
|
|
if (valueInStorage) {
|
|
return valueInStorage === 'true';
|
|
} else {
|
|
localStorage.setItem(key, String(fallback));
|
|
return fallback;
|
|
}
|
|
}
|
|
|
|
export function makeStageKey(key: string) {
|
|
if (baseURI) return `${baseURI}-${key}`;
|
|
return key;
|
|
}
|