refac
This commit is contained in:
1 parent
aa3d569610
commit
2f97c9fce3
1 file changed
+4
-2
@@ -37,6 +37,7 @@
|
|||||||
} from '$lib/apis/terminal';
|
} from '$lib/apis/terminal';
|
||||||
import { isCodeFile } from '$lib/utils/codeHighlight';
|
import { isCodeFile } from '$lib/utils/codeHighlight';
|
||||||
import { isSavedChatId, isTemporaryChatId } from '$lib/utils/chatId';
|
import { isSavedChatId, isTemporaryChatId } from '$lib/utils/chatId';
|
||||||
|
import { copyToClipboard } from '$lib/utils';
|
||||||
import { normalizeDocumentTargetPage } from '$lib/utils/documentPreview';
|
import { normalizeDocumentTargetPage } from '$lib/utils/documentPreview';
|
||||||
|
|
||||||
import Spinner from '../common/Spinner.svelte';
|
import Spinner from '../common/Spinner.svelte';
|
||||||
@@ -1625,8 +1626,9 @@
|
|||||||
<button
|
<button
|
||||||
class="shrink-0 flex h-5 w-5 items-center justify-center rounded transition-colors duration-100 text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300"
|
class="shrink-0 flex h-5 w-5 items-center justify-center rounded transition-colors duration-100 text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300"
|
||||||
on:click={async () => {
|
on:click={async () => {
|
||||||
await navigator.clipboard.writeText(fileContent ?? '');
|
if (await copyToClipboard(fileContent ?? '')) {
|
||||||
toast.success($i18n.t('Copied to clipboard'));
|
toast.success($i18n.t('Copied to clipboard'));
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
aria-label={$i18n.t('Copy')}
|
aria-label={$i18n.t('Copy')}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in new issue
Block a user