Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Merge branch 'dev' into feature/dark-mode

Michael Shamoone6164eb1ab30
diff --cc src-ui/src/app/components/manage/settings/settings.component.ts
index acb456f1c,a90966bb9..a514658fb
--- a/src-ui/src/app/components/manage/settings/settings.component.ts
+++ b/src-ui/src/app/components/manage/settings/settings.component.ts
@@@ -4,8 -4,7 +4,8 @@@ import { PaperlessSavedView } from 'src
import { GENERAL_SETTINGS } from 'src/app/data/storage-keys';
import { DocumentListViewService } from 'src/app/services/document-list-view.service';
import { SavedViewService } from 'src/app/services/rest/saved-view.service';
- import { Toast, ToastService } from 'src/app/services/toast.service';
+ import { ToastService } from 'src/app/services/toast.service';
+import { AppViewService } from 'src/app/services/app-view.service';
@Component({
selector: 'app-settings',
@@@ -58,21 -50,10 +58,21 @@@ export class SettingsComponent implemen
})
}
+ toggleDarkModeSetting() {
+ if (this.settingsForm.value.darkModeUseSystem) {
+ (this.settingsForm.controls.darkModeEnabled as FormControl).disable()
+ } else {
+ (this.settingsForm.controls.darkModeEnabled as FormControl).enable()
+ }
+ }
+
private saveLocalSettings() {
localStorage.setItem(GENERAL_SETTINGS.DOCUMENT_LIST_SIZE, this.settingsForm.value.documentListItemPerPage)
+ localStorage.setItem(GENERAL_SETTINGS.DARK_MODE_USE_SYSTEM, this.settingsForm.value.darkModeUseSystem)
+ localStorage.setItem(GENERAL_SETTINGS.DARK_MODE_ENABLED, (this.settingsForm.value.darkModeEnabled == true).toString())
this.documentListViewService.updatePageSize()
+ this.appViewService.updateDarkModeSettings()
- this.toastService.showToast(Toast.make("Information", $localize`Settings saved successfully.`))
+ this.toastService.showInfo($localize`Settings saved successfully.`)
}
saveSettings() {