perf: freeze constants
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/877/head
parent
d6e108831e
commit
044d94f3b9
|
@ -2,7 +2,7 @@ import { IPhoto } from '../../types';
|
||||||
import { loadState } from '@nextcloud/initial-state';
|
import { loadState } from '@nextcloud/initial-state';
|
||||||
|
|
||||||
/** Global constants */
|
/** Global constants */
|
||||||
export const c = {
|
export const c = Object.freeze({
|
||||||
// Flags for photos
|
// Flags for photos
|
||||||
FLAG_PLACEHOLDER: 1 << 0,
|
FLAG_PLACEHOLDER: 1 << 0,
|
||||||
FLAG_LOAD_FAIL: 1 << 1,
|
FLAG_LOAD_FAIL: 1 << 1,
|
||||||
|
@ -14,16 +14,16 @@ export const c = {
|
||||||
|
|
||||||
// Special strings
|
// Special strings
|
||||||
FACE_NULL: 'NULL',
|
FACE_NULL: 'NULL',
|
||||||
};
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initial state pulled from Nextcloud's HTML page
|
* Initial state pulled from Nextcloud's HTML page
|
||||||
*/
|
*/
|
||||||
export const initState = {
|
export const initState = Object.freeze({
|
||||||
noDownload: loadState('memories', 'no_download', false) !== false,
|
noDownload: loadState('memories', 'no_download', false) !== false,
|
||||||
shareTitle: loadState('memories', 'share_title', '') as string,
|
shareTitle: loadState('memories', 'share_title', '') as string,
|
||||||
singleItem: loadState('memories', 'single_item', null) as IPhoto | null,
|
singleItem: loadState('memories', 'single_item', null) as IPhoto | null,
|
||||||
};
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert server-side flags to bitmask
|
* Convert server-side flags to bitmask
|
||||||
|
|
Loading…
Reference in New Issue