diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-08-27 10:14:17 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-08-27 10:14:17 +0900 |
| commit | 25df56dfd0b97acfb4d6c76c9154f560f56ab150 (patch) | |
| tree | c5d6d73d802875c9a90dde464a7f8d0e4c40f072 /packages | |
| parent | tweak locale (diff) | |
| download | misskey-25df56dfd0b97acfb4d6c76c9154f560f56ab150.tar.gz misskey-25df56dfd0b97acfb4d6c76c9154f560f56ab150.tar.bz2 misskey-25df56dfd0b97acfb4d6c76c9154f560f56ab150.zip | |
refactor
Diffstat (limited to 'packages')
6 files changed, 19 insertions, 24 deletions
diff --git a/packages/frontend/src/components/MkMediaList.vue b/packages/frontend/src/components/MkMediaList.vue index 4a1100c324..bfc8179e13 100644 --- a/packages/frontend/src/components/MkMediaList.vue +++ b/packages/frontend/src/components/MkMediaList.vue @@ -94,6 +94,8 @@ async function calcAspectRatio() { onMounted(() => { calcAspectRatio(); + if (gallery.value == null) return; // TSを黙らすため + lightbox = new PhotoSwipeLightbox({ dataSource: props.mediaList .filter(media => { diff --git a/packages/frontend/src/components/MkPageWindow.vue b/packages/frontend/src/components/MkPageWindow.vue index cf60c1ca3e..d21e09a984 100644 --- a/packages/frontend/src/components/MkPageWindow.vue +++ b/packages/frontend/src/components/MkPageWindow.vue @@ -23,8 +23,8 @@ SPDX-License-Identifier: AGPL-3.0-only </template> <div :class="$style.root" class="_forceShrinkSpacer"> - <StackingRouterView v-if="prefer.s['experimental.stackingRouterView']" :key="reloadCount" :router="windowRouter"/> - <RouterView v-else :key="reloadCount" :router="windowRouter"/> + <StackingRouterView v-if="prefer.s['experimental.stackingRouterView']" :key="reloadCount.toString() + ':stacking'" :router="windowRouter"/> + <RouterView v-else :key="reloadCount.toString() + ':non-stacking'" :router="windowRouter"/> </div> </MkWindow> </template> @@ -58,20 +58,15 @@ const windowRouter = createRouter(props.initialPath); const pageMetadata = ref<null | PageMetadata>(null); const windowEl = useTemplateRef('windowEl'); -const history = ref<{ path: string; }[]>([{ +const _history_ = ref<{ path: string; }[]>([{ path: windowRouter.getCurrentFullPath(), }]); const buttonsLeft = computed(() => { - const buttons: Record<string, unknown>[] = []; - - if (history.value.length > 1) { - buttons.push({ - icon: 'ti ti-arrow-left', - onClick: back, - }); - } - - return buttons; + return _history_.value.length > 1 ? [{ + icon: 'ti ti-arrow-left', + title: i18n.ts.goBack, + onClick: back, + }] : []; }); const buttonsRight = computed(() => { const buttons = [{ @@ -97,12 +92,12 @@ function getSearchMarker(path: string) { const searchMarkerId = ref<string | null>(getSearchMarker(props.initialPath)); windowRouter.addListener('push', ctx => { - history.value.push({ path: ctx.fullPath }); + _history_.value.push({ path: ctx.fullPath }); }); windowRouter.addListener('replace', ctx => { - history.value.pop(); - history.value.push({ path: ctx.fullPath }); + _history_.value.pop(); + _history_.value.push({ path: ctx.fullPath }); }); windowRouter.addListener('change', ctx => { @@ -150,8 +145,8 @@ const contextmenu = computed(() => ([{ }])); function back() { - history.value.pop(); - windowRouter.replaceByPath(history.value.at(-1)!.path); + _history_.value.pop(); + windowRouter.replaceByPath(_history_.value.at(-1)!.path); } function reload() { diff --git a/packages/frontend/src/components/MkRoleSelectDialog.vue b/packages/frontend/src/components/MkRoleSelectDialog.vue index fc7ba50fb3..f1cc98def4 100644 --- a/packages/frontend/src/components/MkRoleSelectDialog.vue +++ b/packages/frontend/src/components/MkRoleSelectDialog.vue @@ -105,9 +105,7 @@ async function addRole() { .map(r => ({ text: r.name, value: r })); const { canceled, result: role } = await os.select({ items }); - if (canceled) { - return; - } + if (canceled || role == null) return; selectedRoleIds.value.push(role.id); } diff --git a/packages/frontend/src/pages/settings/plugin.install.vue b/packages/frontend/src/pages/settings/plugin.install.vue index 22b53b4b96..8ed7f2a7b6 100644 --- a/packages/frontend/src/pages/settings/plugin.install.vue +++ b/packages/frontend/src/pages/settings/plugin.install.vue @@ -40,7 +40,7 @@ async function install() { code.value = null; router.push('/settings/plugin'); - } catch (err) { + } catch (err: any) { os.alert({ type: 'error', title: 'Install failed', diff --git a/packages/frontend/src/pages/welcome.entrance.classic.vue b/packages/frontend/src/pages/welcome.entrance.classic.vue index c2cf937c71..cddec3332e 100644 --- a/packages/frontend/src/pages/welcome.entrance.classic.vue +++ b/packages/frontend/src/pages/welcome.entrance.classic.vue @@ -53,7 +53,7 @@ function getInstanceIcon(instance: Misskey.entities.FederationInstance): string misskeyApiGet('federation/instances', { sort: '+pubSub', limit: 20, - blocked: 'false', + blocked: false, }).then(_instances => { instances.value = _instances; }); diff --git a/packages/frontend/src/utility/extract-mentions.ts b/packages/frontend/src/utility/extract-mentions.ts index d518562053..2ec9349718 100644 --- a/packages/frontend/src/utility/extract-mentions.ts +++ b/packages/frontend/src/utility/extract-mentions.ts @@ -9,7 +9,7 @@ import * as mfm from 'mfm-js'; export function extractMentions(nodes: mfm.MfmNode[]): mfm.MfmMention['props'][] { // TODO: 重複を削除 - const mentionNodes = mfm.extract(nodes, (node) => node.type === 'mention'); + const mentionNodes = mfm.extract(nodes, (node) => node.type === 'mention') as mfm.MfmMention[]; const mentions = mentionNodes.map(x => x.props); return mentions; |