Merge branch 'dev' into feature/dark-mode

This commit is contained in:
Michael Shamoon
2020-12-28 14:28:53 -08:00
committed by GitHub
14 changed files with 138 additions and 74 deletions

View File

@@ -4,7 +4,7 @@ import { PaperlessSavedView } from 'src/app/data/paperless-saved-view';
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({
@@ -54,7 +54,7 @@ export class SettingsComponent implements OnInit {
this.savedViewService.delete(savedView).subscribe(() => {
this.savedViewGroup.removeControl(savedView.id.toString())
this.savedViews.splice(this.savedViews.indexOf(savedView), 1)
this.toastService.showToast(Toast.make("Information", $localize`Saved view "${savedView.name} deleted.`))
this.toastService.showInfo($localize`Saved view "${savedView.name} deleted.`)
})
}
@@ -72,7 +72,7 @@ export class SettingsComponent implements OnInit {
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() {
@@ -84,7 +84,7 @@ export class SettingsComponent implements OnInit {
this.savedViewService.patchMany(x).subscribe(s => {
this.saveLocalSettings()
}, error => {
this.toastService.showToast(Toast.makeError($localize`Error while storing settings on server: ${JSON.stringify(error.error)}`))
this.toastService.showError($localize`Error while storing settings on server: ${JSON.stringify(error.error)}`)
})
} else {
this.saveLocalSettings()