Skip to content

Commit 6b03ce9

Browse files
fix: invoke onError callback when Clipboard API is unavailable
Co-authored-by: Julius Marminge <[email protected]>
1 parent 7d16b8e commit 6b03ce9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

apps/web/src/hooks/useCopyToClipboard.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export function useCopyToClipboard<TContext = void>({
2121

2222
const copyToClipboard = React.useCallback((value: string, ctx: TContext): void => {
2323
if (typeof window === "undefined" || !navigator.clipboard?.writeText) {
24+
onErrorRef.current?.(new Error("Clipboard API unavailable."), ctx);
2425
return;
2526
}
2627

0 commit comments

Comments
 (0)