From 0c34bf26dc292c338e069cd84c952dbe9997df7b Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Wed, 26 Mar 2025 20:27:27 -0400 Subject: [PATCH] restore import/export settings --- .../src/pages/settings/account-data.vue | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/pages/settings/account-data.vue b/packages/frontend/src/pages/settings/account-data.vue index 14bea577a3..84c5400603 100644 --- a/packages/frontend/src/pages/settings/account-data.vue +++ b/packages/frontend/src/pages/settings/account-data.vue @@ -11,7 +11,7 @@ SPDX-License-Identifier: AGPL-3.0-only
- + @@ -23,6 +23,22 @@ SPDX-License-Identifier: AGPL-3.0-only + + + + + + + + + + + + + {{ i18n.ts.import }} + + + @@ -162,6 +178,7 @@ import { ref, computed } from 'vue'; import MkButton from '@/components/MkButton.vue'; import MkFolder from '@/components/MkFolder.vue'; import MkSwitch from '@/components/MkSwitch.vue'; +import MkRadios from '@/components/MkRadios.vue'; import * as os from '@/os.js'; import { misskeyApi } from '@/utility/misskey-api.js'; import { selectFile } from '@/utility/select-file.js'; @@ -173,6 +190,7 @@ import { prefer } from '@/preferences.js'; const excludeMutingUsers = ref(false); const excludeInactiveUsers = ref(false); +const noteType = ref(null); const withReplies = ref(prefer.s.defaultFollowWithReplies); const onExportSuccess = () => { @@ -240,6 +258,14 @@ const importFollowing = async (ev) => { }).then(onImportSuccess).catch(onError); }; +const importNotes = async (ev) => { + const file = await selectFile(ev.currentTarget ?? ev.target); + misskeyApi('i/import-notes', { + fileId: file.id, + type: noteType.value, + }).then(onImportSuccess).catch(onError); +}; + const importUserLists = async (ev) => { const file = await selectFile(ev.currentTarget ?? ev.target); misskeyApi('i/import-user-lists', { fileId: file.id }).then(onImportSuccess).catch(onError);