Merge branch 'main' into onnx-clip-ui

This commit is contained in:
Abhinav 2024-01-11 10:18:38 +05:30
commit 79a60c21b7
2 changed files with 11 additions and 1 deletions

View file

@ -62,6 +62,7 @@ import exportService from 'services/export';
import { REDIRECTS } from 'constants/redirects';
import {
getLocalMapEnabled,
getToken,
setLocalMapEnabled,
} from '@ente/shared/storage/localStorage/helpers';
import { isExportInProgress } from 'utils/export';
@ -76,6 +77,7 @@ import { useLocalState } from '@ente/shared/hooks/useLocalState';
import { PHOTOS_PAGES as PAGES } from '@ente/shared/constants/pages';
import { getTheme } from '@ente/shared/themes';
import { AppUpdateInfo } from '@ente/shared/electron/types';
import DownloadManager from 'services/download';
const redirectMap = new Map([
[REDIRECTS.ROADMAP, getRoadmapRedirectURL],
@ -232,6 +234,14 @@ export default function App(props: EnteAppProps) {
const initExport = async () => {
try {
addLogLine('init export');
const token = getToken();
if (!token) {
addLogLine(
'User not logged in, not starting export continuous sync job'
);
return;
}
await DownloadManager.init(APPS.PHOTOS, { token });
const exportSettings = exportService.getExportSettings();
if (!exportService.exportFolderExists(exportSettings?.folder)) {
return;

View file

@ -9,7 +9,7 @@ export function useLocalState<T>(
useEffect(() => {
const { value } = getData(key) ?? {};
if (value) {
if (typeof value !== 'undefined') {
setValue(value);
}
}, []);