mirror of
https://github.com/ente-io/ente.git
synced 2025-06-06 08:58:55 +00:00
Sentry has a measurable impact on page load, a metric that I'm keen to improve. Apparently by default it loses us 8-9 page speed points, though that can be reduced to 3-4 (https://github.com/getsentry/sentry-javascript/issues/9179). All of this is doable, but there are bigger tasks to deal with. This is not to say that Sentry won't be useful again at some point, when we have time to deal with it better. But right now, we discussed that it's just better to remove Sentry instead of piling on to the sunk cost.
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import { LS_KEYS, getData, setData } from ".";
|
|
|
|
export const getToken = (): string => {
|
|
const token = getData(LS_KEYS.USER)?.token;
|
|
return token;
|
|
};
|
|
|
|
export const getUserID = () => getData(LS_KEYS.USER)?.id;
|
|
|
|
export const isFirstLogin = () =>
|
|
getData(LS_KEYS.IS_FIRST_LOGIN)?.status ?? false;
|
|
|
|
export function setIsFirstLogin(status: boolean) {
|
|
setData(LS_KEYS.IS_FIRST_LOGIN, { status });
|
|
}
|
|
|
|
export const justSignedUp = () =>
|
|
getData(LS_KEYS.JUST_SIGNED_UP)?.status ?? false;
|
|
|
|
export function setJustSignedUp(status: boolean) {
|
|
setData(LS_KEYS.JUST_SIGNED_UP, { status });
|
|
}
|
|
|
|
export function getLivePhotoInfoShownCount() {
|
|
return getData(LS_KEYS.LIVE_PHOTO_INFO_SHOWN_COUNT)?.count ?? 0;
|
|
}
|
|
|
|
export function setLivePhotoInfoShownCount(count: boolean) {
|
|
setData(LS_KEYS.LIVE_PHOTO_INFO_SHOWN_COUNT, { count });
|
|
}
|
|
|
|
export function getLocalMapEnabled(): boolean {
|
|
return getData(LS_KEYS.MAP_ENABLED)?.value ?? false;
|
|
}
|
|
|
|
export function setLocalMapEnabled(value: boolean) {
|
|
setData(LS_KEYS.MAP_ENABLED, { value });
|
|
}
|
|
|
|
export function getLocalReferralSource() {
|
|
return getData(LS_KEYS.REFERRAL_SOURCE)?.source;
|
|
}
|
|
|
|
export function setLocalReferralSource(source: string) {
|
|
setData(LS_KEYS.REFERRAL_SOURCE, { source });
|
|
}
|