mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Tryfix reload for clipboardUtils
This commit is contained in:
@@ -89,7 +89,7 @@ function AppDebug() {
|
||||
Is,
|
||||
BrowserLang,
|
||||
isPWA: isPwa(),
|
||||
supportsClipboardPaste: supportsClipboardRead,
|
||||
supportsClipboardPaste: supportsClipboardRead(),
|
||||
supportsScreenCapture,
|
||||
};
|
||||
const cProduct = {
|
||||
|
||||
@@ -609,7 +609,7 @@ export function Composer(props: {
|
||||
const composerShortcuts: ShortcutObject[] = [];
|
||||
if (showChatAttachments) {
|
||||
composerShortcuts.push({ key: 'f', ctrl: true, shift: true, action: () => openFileForAttaching(true, handleAttachFiles), description: 'Attach File' });
|
||||
if (supportsClipboardRead)
|
||||
if (supportsClipboardRead())
|
||||
composerShortcuts.push({ key: 'v', ctrl: true, shift: true, action: attachAppendClipboardItems, description: 'Attach Clipboard' });
|
||||
}
|
||||
if (recognitionState.isActive) {
|
||||
@@ -743,7 +743,7 @@ export function Composer(props: {
|
||||
</MenuItem>
|
||||
|
||||
{/* Responsive Paste button */}
|
||||
{supportsClipboardRead && <MenuItem>
|
||||
{supportsClipboardRead() && <MenuItem>
|
||||
<ButtonAttachClipboardMemo onClick={attachAppendClipboardItems} />
|
||||
</MenuItem>}
|
||||
|
||||
@@ -769,7 +769,7 @@ export function Composer(props: {
|
||||
<ButtonAttachFilesMemo onAttachFiles={handleAttachFiles} fullWidth multiple />
|
||||
|
||||
{/* Responsive Paste button */}
|
||||
{supportsClipboardRead && <ButtonAttachClipboardMemo onClick={attachAppendClipboardItems} />}
|
||||
{supportsClipboardRead() && <ButtonAttachClipboardMemo onClick={attachAppendClipboardItems} />}
|
||||
|
||||
{/* Responsive Screen Capture button */}
|
||||
{labsAttachScreenCapture && supportsScreenCapture && <ButtonAttachScreenCaptureMemo onAttachScreenCapture={handleAttachScreenCapture} />}
|
||||
|
||||
@@ -54,8 +54,9 @@ export function copyBlobPromiseToClipboard(mimeType: string, blobPromise: Promis
|
||||
});
|
||||
}
|
||||
|
||||
// NOTE: this could be implemented in a platform-agnostic manner with !!.read, but we call it out here for clarity
|
||||
export const supportsClipboardRead = !Is.Browser.Firefox;
|
||||
export function supportsClipboardRead() {
|
||||
return !Is.Browser.Firefox;
|
||||
}
|
||||
|
||||
export async function getClipboardItems(): Promise<ClipboardItem[] | null> {
|
||||
if (!isBrowser || !window.navigator.clipboard?.read)
|
||||
|
||||
Reference in New Issue
Block a user