feat: reset copyStatus on export dialog settings change (#8443)

This commit is contained in:
David Luzar 2024-08-29 15:10:08 +02:00 committed by GitHub
parent 576bc0dbe5
commit 16cae4fc07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 2 deletions

View file

@ -1,4 +1,4 @@
import { useRef, useState } from "react";
import { useCallback, useRef, useState } from "react";
const TIMEOUT = 2000;
@ -15,8 +15,13 @@ export const useCopyStatus = () => {
}, TIMEOUT);
};
const resetCopyStatus = useCallback(() => {
setCopyStatus(null);
}, []);
return {
copyStatus,
resetCopyStatus,
onCopy,
};
};