enhance(frontend): tweak install-extensions behaviour

This commit is contained in:
syuilo 2025-03-20 12:58:01 +09:00
parent fccaadacf0
commit 91670caca0
2 changed files with 11 additions and 12 deletions

View File

@ -12,7 +12,7 @@ import '@/style.scss';
import { mainBoot } from '@/boot/main-boot.js'; import { mainBoot } from '@/boot/main-boot.js';
import { subBoot } from '@/boot/sub-boot.js'; import { subBoot } from '@/boot/sub-boot.js';
const subBootPaths = ['/share', '/auth', '/miauth', '/oauth', '/signup-complete']; const subBootPaths = ['/share', '/auth', '/miauth', '/oauth', '/signup-complete', '/install-extensions'];
if (subBootPaths.some(i => location.pathname === i || location.pathname.startsWith(i + '/'))) { if (subBootPaths.some(i => location.pathname === i || location.pathname.startsWith(i + '/'))) {
subBoot(); subBoot();

View File

@ -8,7 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :contentMax="550"> <MkSpacer :contentMax="550">
<MkLoading v-if="uiPhase === 'fetching'"/> <MkLoading v-if="uiPhase === 'fetching'"/>
<MkExtensionInstaller v-else-if="uiPhase === 'confirm' && data" :extension="data" @confirm="install()" @cancel="close"> <MkExtensionInstaller v-else-if="uiPhase === 'confirm' && data" :extension="data" @confirm="install()" @cancel="close_()">
<template #additionalInfo> <template #additionalInfo>
<FormSection> <FormSection>
<div class="_gaps_s"> <div class="_gaps_s">
@ -34,8 +34,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<h2 :class="$style.extInstallerTitle">{{ errorKV?.title }}</h2> <h2 :class="$style.extInstallerTitle">{{ errorKV?.title }}</h2>
<div :class="$style.extInstallerNormDesc">{{ errorKV?.description }}</div> <div :class="$style.extInstallerNormDesc">{{ errorKV?.description }}</div>
<div class="_buttonsCenter"> <div class="_buttonsCenter">
<MkButton @click="close()">{{ i18n.ts.close }}</MkButton> <MkButton @click="close_()">{{ i18n.ts.close }}</MkButton>
<MkButton @click="goToMisskey()">{{ i18n.ts.goToMisskey }}</MkButton>
</div> </div>
</div> </div>
</MkSpacer> </MkSpacer>
@ -74,12 +73,12 @@ const hash = ref<string | null>(null);
const data = ref<Extension | null>(null); const data = ref<Extension | null>(null);
function close(): void { function close_(): void {
window.close(); if (window.history.length === 1) {
} window.close();
} else {
function goToMisskey(): void { window.history.back();
location.href = '/'; }
} }
async function fetch() { async function fetch() {
@ -207,7 +206,7 @@ async function install() {
await installPlugin(data.value.raw, data.value.meta as AiScriptPluginMeta); await installPlugin(data.value.raw, data.value.meta as AiScriptPluginMeta);
os.success(); os.success();
window.setTimeout(() => { window.setTimeout(() => {
close(); close_();
}, 3000); }, 3000);
} catch (err) { } catch (err) {
errorKV.value = { errorKV.value = {
@ -223,7 +222,7 @@ async function install() {
await installTheme(data.value.raw); await installTheme(data.value.raw);
os.success(); os.success();
window.setTimeout(() => { window.setTimeout(() => {
close(); close_();
}, 3000); }, 3000);
} }
} }