summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts/get-note-menu.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-02-22 18:06:25 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-02-22 18:06:25 +0900
commit76583510419a7a21dfc3c43c9a6e29de791da0fa (patch)
tree07c05b0e5331256140becb55dc85928b6618e272 /packages/frontend/src/scripts/get-note-menu.ts
parentMerge branch 'develop' (diff)
parent13.7.0 (diff)
downloadmisskey-76583510419a7a21dfc3c43c9a6e29de791da0fa.tar.gz
misskey-76583510419a7a21dfc3c43c9a6e29de791da0fa.tar.bz2
misskey-76583510419a7a21dfc3c43c9a6e29de791da0fa.zip
Merge branch 'develop'
Diffstat (limited to 'packages/frontend/src/scripts/get-note-menu.ts')
-rw-r--r--packages/frontend/src/scripts/get-note-menu.ts14
1 files changed, 6 insertions, 8 deletions
diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts
index b5d2251d28..9da7447bfd 100644
--- a/packages/frontend/src/scripts/get-note-menu.ts
+++ b/packages/frontend/src/scripts/get-note-menu.ts
@@ -1,6 +1,5 @@
-import { defineAsyncComponent, Ref, inject } from 'vue';
+import { defineAsyncComponent, Ref } from 'vue';
import * as misskey from 'misskey-js';
-import { pleaseLogin } from './please-login';
import { claimAchievement } from './achievements';
import { $i } from '@/account';
import { i18n } from '@/i18n';
@@ -9,7 +8,6 @@ import * as os from '@/os';
import copyToClipboard from '@/scripts/copy-to-clipboard';
import { url } from '@/config';
import { noteActions } from '@/store';
-import { notePage } from '@/filters/note';
import { miLocalStorage } from '@/local-storage';
export function getNoteMenu(props: {
@@ -202,7 +200,7 @@ export function getNoteMenu(props: {
props.translating.value = true;
const res = await os.api('notes/translate', {
noteId: appearNote.id,
- targetLang: miLocalStorage.getItem('lang') || navigator.language,
+ targetLang: miLocalStorage.getItem('lang') ?? navigator.language,
});
props.translating.value = false;
props.translation.value = res;
@@ -242,7 +240,7 @@ export function getNoteMenu(props: {
icon: 'ti ti-external-link',
text: i18n.ts.showOnRemote,
action: () => {
- window.open(appearNote.url || appearNote.uri, '_blank');
+ window.open(appearNote.url ?? appearNote.uri, '_blank');
},
} : undefined,
{
@@ -292,7 +290,7 @@ export function getNoteMenu(props: {
...($i.isModerator || $i.isAdmin ? [
null,
{
- icon: 'fas fa-bullhorn',
+ icon: 'ti ti-speakerphone',
text: i18n.ts.promote,
action: promote
}]
@@ -304,7 +302,7 @@ export function getNoteMenu(props: {
icon: 'ti ti-exclamation-circle',
text: i18n.ts.reportAbuse,
action: () => {
- const u = appearNote.url || appearNote.uri || `${url}/notes/${appearNote.id}`;
+ const u = appearNote.url ?? appearNote.uri ?? `${url}/notes/${appearNote.id}`;
os.popup(defineAsyncComponent(() => import('@/components/MkAbuseReportWindow.vue')), {
user: appearNote.user,
initialComment: `Note: ${u}\n-----\n`,
@@ -346,7 +344,7 @@ export function getNoteMenu(props: {
icon: 'ti ti-external-link',
text: i18n.ts.showOnRemote,
action: () => {
- window.open(appearNote.url || appearNote.uri, '_blank');
+ window.open(appearNote.url ?? appearNote.uri, '_blank');
},
} : undefined]
.filter(x => x !== undefined);