refactor: change import type to radio

This commit is contained in:
ThatOneCalculator 2023-04-27 01:08:28 -07:00
parent 6f1a7d84d9
commit 17b05511aa
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
1 changed files with 10 additions and 4 deletions

View File

@ -21,9 +21,15 @@
<template #icon
><i class="ph-upload-simple ph-bold ph-lg"></i
></template>
<FormSwitch v-model="signatureCheck" class="_formBlock">
<!-- <FormSwitch v-model="signatureCheck" class="_formBlock">
Mastodon import? (not Akkoma!)
</FormSwitch>
</FormSwitch> -->
<FormRadios v-model="importType" class="_formBlock">
<option value="calckey">Calckey/Misskey</option>
<option value="mastodon">Mastodon</option>
<option disabled value="akkoma">Akkoma (soon)</option>
<option disabled value="mastodon">Twitter (soon)</option>
</FormRadios>
<MkButton
primary
:class="$style.button"
@ -183,7 +189,7 @@ import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
const excludeMutingUsers = ref(false);
const signatureCheck = ref(false);
const importType = ref("calckey");
const excludeInactiveUsers = ref(false);
const onExportSuccess = () => {
@ -215,7 +221,7 @@ const importPosts = async (ev) => {
const file = await selectFile(ev.currentTarget ?? ev.target);
os.api("i/import-posts", {
fileId: file.id,
signatureCheck: signatureCheck.value,
signatureCheck: importType.value === "mastodon" ? true : false,
})
.then(onImportSuccess)
.catch(onError);