summaryrefslogtreecommitdiff
path: root/packages/frontend/src
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-03-20 12:58:01 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2025-03-20 12:58:01 +0900
commit91670caca0e444eac9cf66a0c1767be4187ff804 (patch)
tree3f0243723a9fe2afcaefc6b7e62fbb15944feab1 /packages/frontend/src
parentlint(frontend): improve id-denylist rule (diff)
downloadsharkey-91670caca0e444eac9cf66a0c1767be4187ff804.tar.gz
sharkey-91670caca0e444eac9cf66a0c1767be4187ff804.tar.bz2
sharkey-91670caca0e444eac9cf66a0c1767be4187ff804.zip
enhance(frontend): tweak install-extensions behaviour
Diffstat (limited to 'packages/frontend/src')
-rw-r--r--packages/frontend/src/_boot_.ts2
-rw-r--r--packages/frontend/src/pages/install-extensions.vue21
2 files changed, 11 insertions, 12 deletions
diff --git a/packages/frontend/src/_boot_.ts b/packages/frontend/src/_boot_.ts
index c90cc6bdd0..24fafce18c 100644
--- a/packages/frontend/src/_boot_.ts
+++ b/packages/frontend/src/_boot_.ts
@@ -12,7 +12,7 @@ import '@/style.scss';
import { mainBoot } from '@/boot/main-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 + '/'))) {
subBoot();
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);
}
}