[client] Fix migration page when migrating from/to the same account twice, resolves #514

This commit is contained in:
Laura Hausmann 2024-02-10 15:52:48 +01:00
parent 4b20ab6ad4
commit 63fa244ea8
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -60,6 +60,7 @@ import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata"; import { definePageMetadata } from "@/scripts/page-metadata";
import { $i } from "@/account"; import { $i } from "@/account";
import { toString } from "iceshrimp-js/built/acct"; import { toString } from "iceshrimp-js/built/acct";
import { unique } from "@/scripts/array.js";
let moveToAccount = $ref(""); let moveToAccount = $ref("");
let accountAlias = $ref([""]); let accountAlias = $ref([""]);
@ -68,7 +69,7 @@ await init();
async function init() { async function init() {
if ($i?.alsoKnownAs && $i.alsoKnownAs.length > 0) { if ($i?.alsoKnownAs && $i.alsoKnownAs.length > 0) {
const aka = await os.api("users/show", { userIds: $i.alsoKnownAs }); const aka = await os.api("users/show", { userIds: unique($i.alsoKnownAs) });
accountAlias = accountAlias =
aka && aka.length > 0 aka && aka.length > 0
? aka.map((user) => `@${toString(user)}`) ? aka.map((user) => `@${toString(user)}`)