let storeData = this.getCurrentSettings()
if (this.savedViews) {
+ this.emptyGroup(this.savedViewGroup)
+
for (let view of this.savedViews) {
storeData.savedViews[view.id.toString()] = {
id: view.id,
}
if (this.users && this.groups) {
+ this.emptyGroup(this.usersGroup)
+ this.emptyGroup(this.groupsGroup)
+
for (let user of this.users) {
storeData.usersGroup[user.id.toString()] = {
id: user.id,
}
if (this.mailAccounts && this.mailRules) {
+ this.emptyGroup(this.mailAccountGroup)
+ this.emptyGroup(this.mailRuleGroup)
+
for (let account of this.mailAccounts) {
storeData.mailAccounts[account.id.toString()] = {
id: account.id,
}
}
+ private emptyGroup(group: FormGroup) {
+ Object.keys(group.controls).forEach((key) => group.removeControl(key))
+ }
+
ngOnDestroy() {
if (this.isDirty) this.settings.updateAppearanceSettings() // in case user changed appearance but didnt save
this.storeSub && this.storeSub.unsubscribe()
this.toastService.showInfo(
$localize`Saved view "${savedView.name}" deleted.`
)
+ this.savedViewService.clearCache()
+ this.savedViewService.listAll().subscribe((r) => {
+ this.savedViews = r.results
+ this.initialize(true)
+ })
})
}
this.toastService.showInfo($localize`Deleted user`)
this.usersService.listAll().subscribe((r) => {
this.users = r.results
- this.initialize()
+ this.initialize(true)
})
},
error: (e) => {
this.toastService.showInfo($localize`Deleted group`)
this.groupsService.listAll().subscribe((r) => {
this.groups = r.results
- this.initialize()
+ this.initialize(true)
})
},
error: (e) => {
this.mailAccountService.clearCache()
this.mailAccountService.listAll().subscribe((r) => {
this.mailAccounts = r.results
- this.initialize()
+ this.initialize(true)
})
},
error: (e) => {
this.mailRuleService.listAll().subscribe((r) => {
this.mailRules = r.results
- this.initialize()
+ this.initialize(true)
})
},
error: (e) => {
this.mailRuleService.clearCache()
this.mailRuleService.listAll().subscribe((r) => {
this.mailRules = r.results
- this.initialize()
+ this.initialize(true)
})
},
error: (e) => {