diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-03-20 12:58:01 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-03-20 12:58:01 +0900 |
| commit | 91670caca0e444eac9cf66a0c1767be4187ff804 (patch) | |
| tree | 3f0243723a9fe2afcaefc6b7e62fbb15944feab1 /packages/frontend/src/pages/install-extensions.vue | |
| parent | lint(frontend): improve id-denylist rule (diff) | |
| download | sharkey-91670caca0e444eac9cf66a0c1767be4187ff804.tar.gz sharkey-91670caca0e444eac9cf66a0c1767be4187ff804.tar.bz2 sharkey-91670caca0e444eac9cf66a0c1767be4187ff804.zip | |
enhance(frontend): tweak install-extensions behaviour
Diffstat (limited to 'packages/frontend/src/pages/install-extensions.vue')
| -rw-r--r-- | packages/frontend/src/pages/install-extensions.vue | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/packages/frontend/src/pages/install-extensions.vue b/packages/frontend/src/pages/install-extensions.vue index 3f4a846586..3da6af1a04 100644 --- a/packages/frontend/src/pages/install-extensions.vue +++ b/packages/frontend/src/pages/install-extensions.vue @@ -8,7 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only <template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template> <MkSpacer :contentMax="550"> <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> <FormSection> <div class="_gaps_s"> @@ -34,8 +34,7 @@ SPDX-License-Identifier: AGPL-3.0-only <h2 :class="$style.extInstallerTitle">{{ errorKV?.title }}</h2> <div :class="$style.extInstallerNormDesc">{{ errorKV?.description }}</div> <div class="_buttonsCenter"> - <MkButton @click="close()">{{ i18n.ts.close }}</MkButton> - <MkButton @click="goToMisskey()">{{ i18n.ts.goToMisskey }}</MkButton> + <MkButton @click="close_()">{{ i18n.ts.close }}</MkButton> </div> </div> </MkSpacer> @@ -74,12 +73,12 @@ const hash = ref<string | null>(null); const data = ref<Extension | null>(null); -function close(): void { - window.close(); -} - -function goToMisskey(): void { - location.href = '/'; +function close_(): void { + if (window.history.length === 1) { + window.close(); + } else { + window.history.back(); + } } async function fetch() { @@ -207,7 +206,7 @@ async function install() { await installPlugin(data.value.raw, data.value.meta as AiScriptPluginMeta); os.success(); window.setTimeout(() => { - close(); + close_(); }, 3000); } catch (err) { errorKV.value = { @@ -223,7 +222,7 @@ async function install() { await installTheme(data.value.raw); os.success(); window.setTimeout(() => { - close(); + close_(); }, 3000); } } |