@@ -4,7 +4,7 @@ import { AppSidebar } from '@/components/app-sidebar';
44import { Fragment , useEffect , useState } from 'react' ;
55import { load , Store } from '@tauri-apps/plugin-store' ;
66import { useAtom , useSetAtom } from 'jotai/react' ;
7- import { appStateAtom , AppStateT , downloadStatusAtom , libraryStateAtom , LibraryStateT , sourceDownloadOptions } from '@/lib/store' ;
7+ import { appStateAtom , AppStateT , downloadStatusAtom , getSourceDownloadOptions , libraryStateAtom , LibraryStateT } from '@/lib/store' ;
88import Loader from '@/components/loader' ;
99import * as path from '@tauri-apps/api/path' ;
1010import { createLibraryDir , saveNovelChapters } from '@/lib/library/library' ;
@@ -89,10 +89,11 @@ function RootComponent() {
8989 if ( ! app ) app = appState ;
9090
9191 if ( app . version === 1 ) {
92- delete ( app as AppStateV1T ) . downloadBatchSize ;
93- delete ( app as AppStateV1T ) . downloadBatchDelay ;
94- app . viewedNotesForVersion
95- app . sourceDownloadOptions = sourceDownloadOptions ;
92+ const oldApp = app as AppStateV1T ;
93+ app . viewedNotesForVersion = undefined ;
94+ app . sourceDownloadOptions = getSourceDownloadOptions ( oldApp . downloadBatchSize , oldApp . downloadBatchDelay ) ;
95+ delete oldApp . downloadBatchSize ;
96+ delete oldApp . downloadBatchDelay ;
9697 app . version = 2 ;
9798 }
9899
0 commit comments