This commit is contained in:
syuilo 2025-08-27 10:14:17 +09:00
parent 231ccae006
commit 25df56dfd0
6 changed files with 19 additions and 24 deletions

View File

@ -94,6 +94,8 @@ async function calcAspectRatio() {
onMounted(() => { onMounted(() => {
calcAspectRatio(); calcAspectRatio();
if (gallery.value == null) return; // TS
lightbox = new PhotoSwipeLightbox({ lightbox = new PhotoSwipeLightbox({
dataSource: props.mediaList dataSource: props.mediaList
.filter(media => { .filter(media => {

View File

@ -23,8 +23,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</template> </template>
<div :class="$style.root" class="_forceShrinkSpacer"> <div :class="$style.root" class="_forceShrinkSpacer">
<StackingRouterView v-if="prefer.s['experimental.stackingRouterView']" :key="reloadCount" :router="windowRouter"/> <StackingRouterView v-if="prefer.s['experimental.stackingRouterView']" :key="reloadCount.toString() + ':stacking'" :router="windowRouter"/>
<RouterView v-else :key="reloadCount" :router="windowRouter"/> <RouterView v-else :key="reloadCount.toString() + ':non-stacking'" :router="windowRouter"/>
</div> </div>
</MkWindow> </MkWindow>
</template> </template>
@ -58,20 +58,15 @@ const windowRouter = createRouter(props.initialPath);
const pageMetadata = ref<null | PageMetadata>(null); const pageMetadata = ref<null | PageMetadata>(null);
const windowEl = useTemplateRef('windowEl'); const windowEl = useTemplateRef('windowEl');
const history = ref<{ path: string; }[]>([{ const _history_ = ref<{ path: string; }[]>([{
path: windowRouter.getCurrentFullPath(), path: windowRouter.getCurrentFullPath(),
}]); }]);
const buttonsLeft = computed(() => { const buttonsLeft = computed(() => {
const buttons: Record<string, unknown>[] = []; return _history_.value.length > 1 ? [{
icon: 'ti ti-arrow-left',
if (history.value.length > 1) { title: i18n.ts.goBack,
buttons.push({ onClick: back,
icon: 'ti ti-arrow-left', }] : [];
onClick: back,
});
}
return buttons;
}); });
const buttonsRight = computed(() => { const buttonsRight = computed(() => {
const buttons = [{ const buttons = [{
@ -97,12 +92,12 @@ function getSearchMarker(path: string) {
const searchMarkerId = ref<string | null>(getSearchMarker(props.initialPath)); const searchMarkerId = ref<string | null>(getSearchMarker(props.initialPath));
windowRouter.addListener('push', ctx => { windowRouter.addListener('push', ctx => {
history.value.push({ path: ctx.fullPath }); _history_.value.push({ path: ctx.fullPath });
}); });
windowRouter.addListener('replace', ctx => { windowRouter.addListener('replace', ctx => {
history.value.pop(); _history_.value.pop();
history.value.push({ path: ctx.fullPath }); _history_.value.push({ path: ctx.fullPath });
}); });
windowRouter.addListener('change', ctx => { windowRouter.addListener('change', ctx => {
@ -150,8 +145,8 @@ const contextmenu = computed(() => ([{
}])); }]));
function back() { function back() {
history.value.pop(); _history_.value.pop();
windowRouter.replaceByPath(history.value.at(-1)!.path); windowRouter.replaceByPath(_history_.value.at(-1)!.path);
} }
function reload() { function reload() {

View File

@ -105,9 +105,7 @@ async function addRole() {
.map(r => ({ text: r.name, value: r })); .map(r => ({ text: r.name, value: r }));
const { canceled, result: role } = await os.select({ items }); const { canceled, result: role } = await os.select({ items });
if (canceled) { if (canceled || role == null) return;
return;
}
selectedRoleIds.value.push(role.id); selectedRoleIds.value.push(role.id);
} }

View File

@ -40,7 +40,7 @@ async function install() {
code.value = null; code.value = null;
router.push('/settings/plugin'); router.push('/settings/plugin');
} catch (err) { } catch (err: any) {
os.alert({ os.alert({
type: 'error', type: 'error',
title: 'Install failed', title: 'Install failed',

View File

@ -53,7 +53,7 @@ function getInstanceIcon(instance: Misskey.entities.FederationInstance): string
misskeyApiGet('federation/instances', { misskeyApiGet('federation/instances', {
sort: '+pubSub', sort: '+pubSub',
limit: 20, limit: 20,
blocked: 'false', blocked: false,
}).then(_instances => { }).then(_instances => {
instances.value = _instances; instances.value = _instances;
}); });

View File

@ -9,7 +9,7 @@ import * as mfm from 'mfm-js';
export function extractMentions(nodes: mfm.MfmNode[]): mfm.MfmMention['props'][] { export function extractMentions(nodes: mfm.MfmNode[]): mfm.MfmMention['props'][] {
// TODO: 重複を削除 // 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); const mentions = mentionNodes.map(x => x.props);
return mentions; return mentions;