mirror of
https://github.com/immich-app/immich.git
synced 2025-12-22 01:11:20 +03:00
* feat(web): lighter timeline buckets * GalleryViewer * weird ssr * Remove generics from AssetInteraction * ensure keys on getAssetInfo, alt-text * empty - trigger ci * re-add alt-text * test fix * update tests * tests * missing import * fix: flappy e2e test * lint * revert settings * unneeded cast * fix after merge * missing import * lint * review * lint * avoid abbreviations * review comment - type safety in test * merge conflicts * lint * lint/abbreviations * fix: left-over migration --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
35 lines
989 B
TypeScript
35 lines
989 B
TypeScript
import { browser } from '$app/environment';
|
|
|
|
function getBoolean(string: string | null, fallback: boolean) {
|
|
if (string === null) {
|
|
return fallback;
|
|
}
|
|
return 'true' === string;
|
|
}
|
|
function getNumber(string: string | null, fallback: number) {
|
|
if (string === null) {
|
|
return fallback;
|
|
}
|
|
return Number.parseInt(string);
|
|
}
|
|
const storage = browser
|
|
? localStorage
|
|
: {
|
|
getItem: () => null,
|
|
};
|
|
export const TUNABLES = {
|
|
LAYOUT: {
|
|
WASM: getBoolean(storage.getItem('LAYOUT.WASM'), false),
|
|
},
|
|
TIMELINE: {
|
|
INTERSECTION_EXPAND_TOP: getNumber(storage.getItem('TIMELINE_INTERSECTION_EXPAND_TOP'), 500),
|
|
INTERSECTION_EXPAND_BOTTOM: getNumber(storage.getItem('TIMELINE_INTERSECTION_EXPAND_BOTTOM'), 500),
|
|
},
|
|
ASSET_GRID: {
|
|
NAVIGATE_ON_ASSET_IN_VIEW: getBoolean(storage.getItem('ASSET_GRID.NAVIGATE_ON_ASSET_IN_VIEW'), false),
|
|
},
|
|
IMAGE_THUMBNAIL: {
|
|
THUMBHASH_FADE_DURATION: getNumber(storage.getItem('THUMBHASH_FADE_DURATION'), 150),
|
|
},
|
|
};
|