summaryrefslogtreecommitdiff
path: root/packages/frontend/src/pages/settings/theme.install.vue
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-03-10 09:28:07 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2025-03-10 09:28:07 +0900
commitd9858b03c93c57b3cb7b0cec19e8b0b3c0572334 (patch)
tree0c90a0754c6a424a2d9ce122854938b67f6be4b1 /packages/frontend/src/pages/settings/theme.install.vue
parentfix(dev): 検索インデックス対象ファイルでHMRが効かない問... (diff)
downloadsharkey-d9858b03c93c57b3cb7b0cec19e8b0b3c0572334.tar.gz
sharkey-d9858b03c93c57b3cb7b0cec19e8b0b3c0572334.tar.bz2
sharkey-d9858b03c93c57b3cb7b0cec19e8b0b3c0572334.zip
enhance(frontend): improve plugin management
Diffstat (limited to 'packages/frontend/src/pages/settings/theme.install.vue')
-rw-r--r--packages/frontend/src/pages/settings/theme.install.vue8
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/frontend/src/pages/settings/theme.install.vue b/packages/frontend/src/pages/settings/theme.install.vue
index c731f343e2..92f4893f1a 100644
--- a/packages/frontend/src/pages/settings/theme.install.vue
+++ b/packages/frontend/src/pages/settings/theme.install.vue
@@ -10,8 +10,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkCodeEditor>
<div class="_buttons">
- <MkButton :disabled="installThemeCode == null" inline @click="() => previewTheme(installThemeCode)"><i class="ti ti-eye"></i> {{ i18n.ts.preview }}</MkButton>
- <MkButton :disabled="installThemeCode == null" primary inline @click="() => install(installThemeCode)"><i class="ti ti-check"></i> {{ i18n.ts.install }}</MkButton>
+ <MkButton :disabled="installThemeCode == null || installThemeCode.trim() === ''" inline @click="() => previewTheme(installThemeCode)"><i class="ti ti-eye"></i> {{ i18n.ts.preview }}</MkButton>
+ <MkButton :disabled="installThemeCode == null || installThemeCode.trim() === ''" primary inline @click="() => install(installThemeCode)"><i class="ti ti-check"></i> {{ i18n.ts.install }}</MkButton>
</div>
</div>
</template>
@@ -24,7 +24,9 @@ import { parseThemeCode, previewTheme, installTheme } from '@/theme.js';
import * as os from '@/os.js';
import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/utility/page-metadata.js';
+import { useRouter } from '@/router/supplier.js';
+const router = useRouter();
const installThemeCode = ref<string | null>(null);
async function install(code: string): Promise<void> {
@@ -35,6 +37,8 @@ async function install(code: string): Promise<void> {
type: 'success',
text: i18n.tsx._theme.installed({ name: theme.name }),
});
+ installThemeCode.value = null;
+ router.push('/settings/theme');
} catch (err) {
switch (err.message.toLowerCase()) {
case 'this theme is already installed':