summaryrefslogtreecommitdiff
path: root/packages/frontend/src/utility
diff options
context:
space:
mode:
Diffstat (limited to 'packages/frontend/src/utility')
-rw-r--r--packages/frontend/src/utility/copy-to-clipboard.ts8
-rw-r--r--packages/frontend/src/utility/get-drive-file-menu.ts1
-rw-r--r--packages/frontend/src/utility/get-embed-code.ts5
-rw-r--r--packages/frontend/src/utility/get-note-menu.ts5
4 files changed, 9 insertions, 10 deletions
diff --git a/packages/frontend/src/utility/copy-to-clipboard.ts b/packages/frontend/src/utility/copy-to-clipboard.ts
index 7e0bb25606..08a759588e 100644
--- a/packages/frontend/src/utility/copy-to-clipboard.ts
+++ b/packages/frontend/src/utility/copy-to-clipboard.ts
@@ -3,9 +3,15 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
+import * as os from '@/os.js';
+import { i18n } from '@/i18n.js';
+
/**
* Clipboardに値をコピー(TODO: 文字列以外も対応)
*/
export function copyToClipboard(input: string | null) {
- if (input) navigator.clipboard.writeText(input);
+ if (input) {
+ navigator.clipboard.writeText(input);
+ os.toast(i18n.ts.copiedToClipboard);
+ }
};
diff --git a/packages/frontend/src/utility/get-drive-file-menu.ts b/packages/frontend/src/utility/get-drive-file-menu.ts
index 0212a051ce..3c6cbba002 100644
--- a/packages/frontend/src/utility/get-drive-file-menu.ts
+++ b/packages/frontend/src/utility/get-drive-file-menu.ts
@@ -65,7 +65,6 @@ function toggleSensitive(file: Misskey.entities.DriveFile) {
function copyUrl(file: Misskey.entities.DriveFile) {
copyToClipboard(file.url);
- os.success();
}
/*
diff --git a/packages/frontend/src/utility/get-embed-code.ts b/packages/frontend/src/utility/get-embed-code.ts
index 9021520da8..d458e64f19 100644
--- a/packages/frontend/src/utility/get-embed-code.ts
+++ b/packages/frontend/src/utility/get-embed-code.ts
@@ -4,11 +4,11 @@
*/
import { defineAsyncComponent } from 'vue';
import { v4 as uuid } from 'uuid';
-import type { EmbedParams, EmbeddableEntity } from '@@/js/embed-page.js';
import { url } from '@@/js/config.js';
+import { defaultEmbedParams, embedRouteWithScrollbar } from '@@/js/embed-page.js';
+import type { EmbedParams, EmbeddableEntity } from '@@/js/embed-page.js';
import * as os from '@/os.js';
import { copyToClipboard } from '@/utility/copy-to-clipboard.js';
-import { defaultEmbedParams, embedRouteWithScrollbar } from '@@/js/embed-page.js';
const MOBILE_THRESHOLD = 500;
@@ -74,7 +74,6 @@ export function genEmbedCode(entity: EmbeddableEntity, id: string, params?: Embe
// PCじゃない場合はコードカスタマイズ画面を出さずにそのままコピー
if (window.innerWidth < MOBILE_THRESHOLD) {
copyToClipboard(getEmbedCode(`/embed/${entity}/${id}`, _params));
- os.success();
} else {
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkEmbedCodeGenDialog.vue')), {
entity,
diff --git a/packages/frontend/src/utility/get-note-menu.ts b/packages/frontend/src/utility/get-note-menu.ts
index dea9bc39ad..9e1ae7e9ac 100644
--- a/packages/frontend/src/utility/get-note-menu.ts
+++ b/packages/frontend/src/utility/get-note-menu.ts
@@ -157,7 +157,6 @@ export function getCopyNoteLinkMenu(note: Misskey.entities.Note, text: string):
text,
action: (): void => {
copyToClipboard(`${url}/notes/${note.id}`);
- os.success();
},
};
}
@@ -237,7 +236,6 @@ export function getNoteMenu(props: {
function copyContent(): void {
copyToClipboard(appearNote.text);
- os.success();
}
function togglePin(pin: boolean): void {
@@ -324,7 +322,6 @@ export function getNoteMenu(props: {
text: i18n.ts.copyRemoteLink,
action: () => {
copyToClipboard(appearNote.url ?? appearNote.uri);
- os.success();
},
}, {
icon: 'ti ti-external-link',
@@ -483,7 +480,6 @@ export function getNoteMenu(props: {
text: i18n.ts.copyRemoteLink,
action: () => {
copyToClipboard(appearNote.url ?? appearNote.uri);
- os.success();
},
}, {
icon: 'ti ti-external-link',
@@ -516,7 +512,6 @@ export function getNoteMenu(props: {
text: i18n.ts.copyNoteId,
action: () => {
copyToClipboard(appearNote.id);
- os.success();
},
});
}