cleanup for show-note-on-original-instance fixes

This commit is contained in:
bunnybeam 2025-10-26 11:44:21 +00:00
parent 7c92c2215d
commit 3c3a7b6cbb
No known key found for this signature in database
5 changed files with 11 additions and 11 deletions

View file

@ -4,12 +4,12 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<div :class="$style.root"><i class="ti ti-alert-triangle" style="margin-right: 8px;"></i>{{ i18n.ts.remoteUserCaution }} <MkLink v-if="href" :class="$style.link" :url="href" target="_blank">{{ i18n.ts.showOnRemote }}</MkLink></div>
<div :class="$style.root"><i class="ti ti-alert-triangle" style="margin-right: 8px;"></i>{{ i18n.ts.remoteUserCaution }} <a v-if="href" :class="$style.link" :href="href" rel="nofollow noopener" target="_blank" @click.prevent="warningExternalWebsite(href)" @click.stop>{{ i18n.ts.showOnRemote }}</a></div>
</template>
<script lang="ts" setup>
import { i18n } from '@/i18n.js';
import MkLink from '@/components/MkLink.vue';
import { warningExternalWebsite } from '@/utility/warning-external-website.js';
defineProps<{
href?: string;

View file

@ -79,7 +79,7 @@ Detailed view of a note in the Sharkey style. Used when opening a note onto its
<span v-if="appearNote.updatedAt" ref="menuVersionsButton" style="margin-left: 0.5em;" title="Edited" @mousedown="menuVersions()"><i class="ph-pencil-simple ph-bold ph-lg"></i></span>
<span v-if="appearNote.localOnly" style="margin-left: 0.5em;" :title="i18n.ts._visibility['disableFederation']"><i class="ti ti-rocket-off"></i></span>
</div>
<SkInstanceTicker v-if="showTicker" style="cursor: pointer;" :host="appearNote.user.host" :instance="appearNote.user.instance" @click.stop="showOnRemote(props.note)"/>
<SkInstanceTicker v-if="showTicker" style="cursor: pointer;" :host="appearNote.user.host" :instance="appearNote.user.instance" @click.stop="showNoteOnOriginalInstance(appearNote)"/>
</div>
</div>
</header>
@ -290,7 +290,7 @@ import SkNoteTranslation from '@/components/SkNoteTranslation.vue';
import { getSelfNoteIds } from '@/utility/get-self-note-ids.js';
import SkUrlPreviewGroup from '@/components/SkUrlPreviewGroup.vue';
import MkNoteSub from '@/components/MkNoteSub.vue';
import { showOnRemote } from '@/utility/show-on-remote.js';
import { showNoteOnOriginalInstance } from '@/utility/show-note-on-original-instance.js';
const props = withDefaults(defineProps<{
note: Misskey.entities.Note;

View file

@ -40,7 +40,7 @@ Header for a note in the Sharkey style, displaying info such as username and cre
<span v-if="note.channel" style="margin-left: 0.5em;" :title="note.channel.name"><i class="ph-television ph-bold ph-lg"></i></span>
</div>
<div :class="$style.info">
<SkInstanceTicker v-if="showTicker" style="cursor: pointer;" :instance="note.user.instance" :host="note.user.host" @click.stop="showOnRemote(props.note)"/>
<SkInstanceTicker v-if="showTicker" style="cursor: pointer;" :instance="note.user.instance" :host="note.user.host" @click.stop="showNoteOnOriginalInstance(note)"/>
</div>
</div>
</header>
@ -56,7 +56,7 @@ Header for a note in the Sharkey style, displaying info such as username and cre
<div v-if="note.user.badgeRoles" :class="$style.badgeRoles">
<img v-for="(role, i) in note.user.badgeRoles" :key="i" v-tooltip="role.name" :class="$style.badgeRole" :src="role.iconUrl ?? ''"/>
</div>
<SkInstanceTicker v-if="showTicker && !isMobile && prefer.s.showTickerOnReplies" style="cursor: pointer; max-height: 5px; top: 3px; position: relative; margin-top: 0 !important;" :instance="note.user.instance" :host="note.user.host" @click.stop="showOnRemote(props.note)"/>
<SkInstanceTicker v-if="showTicker && !isMobile && prefer.s.showTickerOnReplies" style="cursor: pointer; max-height: 5px; top: 3px; position: relative; margin-top: 0 !important;" :instance="note.user.instance" :host="note.user.host" @click.stop="showNoteOnOriginalInstance(note)"/>
<div :class="$style.classicInfo">
<div v-if="mock">
<MkTime :time="note.createdAt" colored/>
@ -89,7 +89,7 @@ import { prefer } from '@/preferences';
import { useRouter } from '@/router';
import { deviceKind } from '@/utility/device-kind';
import SkInstanceTicker from '@/components/SkInstanceTicker.vue';
import { showOnRemote } from '@/utility/show-on-remote.js';
import { showNoteOnOriginalInstance } from '@/utility/show-note-on-original-instance.js';
const props = defineProps<{
note: Misskey.entities.Note;

View file

@ -25,7 +25,7 @@ import { getAppearNote } from '@/utility/get-appear-note.js';
import { genEmbedCode } from '@/utility/get-embed-code.js';
import { prefer } from '@/preferences.js';
import { getPluginHandlers } from '@/plugin.js';
import { showOnRemote } from '@/utility/show-on-remote.js';
import { showNoteOnOriginalInstance } from '@/utility/show-note-on-original-instance.js';
export async function getNoteClipMenu(props: {
note: Misskey.entities.Note;
@ -360,7 +360,7 @@ export function getNoteMenu(props: {
icon: 'ti ti-external-link',
text: i18n.ts.showOnRemote,
action: () => {
showOnRemote(appearNote);
showNoteOnOriginalInstance(appearNote);
},
});
} else {
@ -549,7 +549,7 @@ export function getNoteMenu(props: {
icon: 'ti ti-external-link',
text: i18n.ts.showOnRemote,
action: () => {
showOnRemote(appearNote);
showNoteOnOriginalInstance(appearNote);
},
});
} else {

View file

@ -13,7 +13,7 @@ const router = useRouter();
/**
* Show a note on the remote instance, if possible. Otherwise, show the local note.
*/
export function showOnRemote(note: entities.Note) {
export function showNoteOnOriginalInstance(note: entities.Note) {
const remoteUrl = note.url ?? note.uri;
if (remoteUrl) {
warningExternalWebsite(remoteUrl);