1
0

chore(frontend): use toast to show message when call copyToClipboard

This commit is contained in:
syuilo
2025-03-16 15:04:38 +09:00
parent 32844e4775
commit 81a0cbd294
21 changed files with 16 additions and 27 deletions
@@ -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);
}
};