diff --git a/src/app/modules/main/controller.nim b/src/app/modules/main/controller.nim index f18b723f20..530d2de9e7 100644 --- a/src/app/modules/main/controller.nim +++ b/src/app/modules/main/controller.nim @@ -81,6 +81,10 @@ proc delete*(self: Controller) = discard proc init*(self: Controller) = + if self.accountsService.isFirstTimeAccountLogin(): + let d9 = 9*86400 # 9 days + discard self.settingsService.setDefaultSyncPeriod(d9) + self.events.on("mailserverAvailable") do(e:Args): echo "MAILSERVER AVAILABLE: ", repr(e) # We need to take some actions here. This is the only pace where "mailserverAvailable" signal should be handled. diff --git a/src/app_service/service/settings/service.nim b/src/app_service/service/settings/service.nim index 70903445f7..c5a420e8bc 100644 --- a/src/app_service/service/settings/service.nim +++ b/src/app_service/service/settings/service.nim @@ -435,6 +435,12 @@ QtObject: proc autoMessageEnabled*(self: Service): bool = return self.settings.autoMessageEnabled + proc setDefaultSyncPeriod*(self: Service, value: int): bool = + if(self.saveSetting(KEY_DEFAULT_SYNC_PERIOD,value)): + self.settings.defaultSyncPeriod = value + return true + return false + proc getWakuBloomFilterMode*(self: Service): bool = return self.settings.wakuBloomFilterMode