fix: Nutstore auto-sync when app starts (#5005)
feat: integrate Nutstore auto-sync functionality in initialization process
This commit is contained in:
parent
53f74725ed
commit
456f0657a6
@ -3,6 +3,7 @@ import './utils/analytics'
|
|||||||
import KeyvStorage from '@kangfenmao/keyv-storage'
|
import KeyvStorage from '@kangfenmao/keyv-storage'
|
||||||
|
|
||||||
import { startAutoSync } from './services/BackupService'
|
import { startAutoSync } from './services/BackupService'
|
||||||
|
import { startNutstoreAutoSync } from './services/NutstoreService'
|
||||||
import store from './store'
|
import store from './store'
|
||||||
|
|
||||||
function initSpinner() {
|
function initSpinner() {
|
||||||
@ -20,9 +21,13 @@ function initKeyv() {
|
|||||||
function initAutoSync() {
|
function initAutoSync() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const { webdavAutoSync } = store.getState().settings
|
const { webdavAutoSync } = store.getState().settings
|
||||||
|
const { nutstoreAutoSync } = store.getState().nutstore
|
||||||
if (webdavAutoSync) {
|
if (webdavAutoSync) {
|
||||||
startAutoSync()
|
startAutoSync()
|
||||||
}
|
}
|
||||||
|
if (nutstoreAutoSync) {
|
||||||
|
startNutstoreAutoSync()
|
||||||
|
}
|
||||||
}, 2000)
|
}, 2000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user