summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts/get-note-menu.ts
diff options
context:
space:
mode:
authormisskey-release-bot[bot] <157398866+misskey-release-bot[bot]@users.noreply.github.com>2025-01-28 12:29:14 +0000
committerGitHub <noreply@github.com>2025-01-28 12:29:14 +0000
commit36880493cb16e87feb83484498fcd3cc871eb68d (patch)
tree277127cf0e6c6990577935c5bb5dff9269c605b0 /packages/frontend/src/scripts/get-note-menu.ts
parentMerge pull request #14924 from misskey-dev/develop (diff)
parentRelease: 2025.1.0 (diff)
downloadmisskey-36880493cb16e87feb83484498fcd3cc871eb68d.tar.gz
misskey-36880493cb16e87feb83484498fcd3cc871eb68d.tar.bz2
misskey-36880493cb16e87feb83484498fcd3cc871eb68d.zip
Merge pull request #15279 from misskey-dev/develop
Release: 2025.1.0
Diffstat (limited to 'packages/frontend/src/scripts/get-note-menu.ts')
-rw-r--r--packages/frontend/src/scripts/get-note-menu.ts27
1 files changed, 18 insertions, 9 deletions
diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts
index c1846b0589..bc504077b0 100644
--- a/packages/frontend/src/scripts/get-note-menu.ts
+++ b/packages/frontend/src/scripts/get-note-menu.ts
@@ -5,19 +5,19 @@
import { defineAsyncComponent, Ref, ShallowRef } from 'vue';
import * as Misskey from 'misskey-js';
+import { url } from '@@/js/config.js';
import { claimAchievement } from './achievements.js';
+import type { MenuItem } from '@/types/menu.js';
import { $i } from '@/account.js';
import { i18n } from '@/i18n.js';
import { instance } from '@/instance.js';
import * as os from '@/os.js';
import { misskeyApi } from '@/scripts/misskey-api.js';
import { copyToClipboard } from '@/scripts/copy-to-clipboard.js';
-import { url } from '@@/js/config.js';
import { defaultStore, noteActions } from '@/store.js';
import { miLocalStorage } from '@/local-storage.js';
import { getUserMenu } from '@/scripts/get-user-menu.js';
import { clipsCache, favoritedChannelsCache } from '@/cache.js';
-import type { MenuItem } from '@/types/menu.js';
import MkRippleEffect from '@/components/MkRippleEffect.vue';
import { isSupportShare } from '@/scripts/navigator.js';
import { getAppearNote } from '@/scripts/get-appear-note.js';
@@ -194,7 +194,7 @@ export function getNoteMenu(props: {
noteId: appearNote.id,
});
- if (Date.now() - new Date(appearNote.createdAt).getTime() < 1000 * 60) {
+ if (Date.now() - new Date(appearNote.createdAt).getTime() < 1000 * 60 && appearNote.userId === $i.id) {
claimAchievement('noteDeletedWithin1min');
}
});
@@ -213,7 +213,7 @@ export function getNoteMenu(props: {
os.post({ initialNote: appearNote, renote: appearNote.renote, reply: appearNote.reply, channel: appearNote.channel });
- if (Date.now() - new Date(appearNote.createdAt).getTime() < 1000 * 60) {
+ if (Date.now() - new Date(appearNote.createdAt).getTime() < 1000 * 60 && appearNote.userId === $i.id) {
claimAchievement('noteDeletedWithin1min');
}
});
@@ -237,11 +237,6 @@ export function getNoteMenu(props: {
os.success();
}
- function copyLink(): void {
- copyToClipboard(`${url}/notes/${appearNote.id}`);
- os.success();
- }
-
function togglePin(pin: boolean): void {
os.apiWithDialog(pin ? 'i/pin' : 'i/unpin', {
noteId: appearNote.id,
@@ -322,6 +317,13 @@ export function getNoteMenu(props: {
if (appearNote.url || appearNote.uri) {
menuItems.push({
+ icon: 'ti ti-link',
+ text: i18n.ts.copyRemoteLink,
+ action: () => {
+ copyToClipboard(appearNote.url ?? appearNote.uri);
+ os.success();
+ },
+ }, {
icon: 'ti ti-external-link',
text: i18n.ts.showOnRemote,
action: () => {
@@ -474,6 +476,13 @@ export function getNoteMenu(props: {
if (appearNote.url || appearNote.uri) {
menuItems.push({
+ icon: 'ti ti-link',
+ text: i18n.ts.copyRemoteLink,
+ action: () => {
+ copyToClipboard(appearNote.url ?? appearNote.uri);
+ os.success();
+ },
+ }, {
icon: 'ti ti-external-link',
text: i18n.ts.showOnRemote,
action: () => {