Ver código fonte

Merge branch 'main' into dependabot/npm_and_yarn/follow-redirects-1.15.4

Abhinav Kumar 1 ano atrás
pai
commit
0ebf00973e
1 arquivos alterados com 10 adições e 0 exclusões
  1. 10 0
      apps/photos/src/pages/_app.tsx

+ 10 - 0
apps/photos/src/pages/_app.tsx

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