feat: add settings import/export

This commit is contained in:
Xylight committed 2024-07-09 16:58:49 -07:00
1 parent 02912341f8
commit 1db0e0f880
3 files changed
+82 -14

No files matched your search

+6 -1
View File
@@ -529,7 +529,9 @@
"waitApplication": "Wait for your registration application to be accepted before logging in.",
"blockUser": "Blocked that user.",
"unblockUser": "Unblocked that user.",
"purgeUser": "Purged that user."
"purgeUser": "Purged that user.",
"settingsImport": "Successfully imported settings",
"settingsImportWarning": "The imported settings don't seem valid. Are you sure you want to import this?"
},
"settings": {
"title": "Settings",
@@ -537,6 +539,9 @@
"desktop": "Desktop",
"tablet": "Tablet",
"mobile": "Mobile",
"export": "Export",
"import": "Import",
"reset": "Reset",
"navigation": {
"title": "Navigation",
"dockPos": {
+1 -1
View File
@@ -176,7 +176,7 @@ export const defaultSettings: Settings = {
export const userSettings = writable(defaultSettings)
const migrate = (settings: any): Settings => {
if (typeof settings.moderation.removalReasonPreset == 'string') {
if (typeof settings?.moderation?.removalReasonPreset == 'string') {
settings.moderation.presets = [
{
title: 'Preset 1',