mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
f13c190676
* fix: is in iframe validation check * chore: remove/ disable all actionable items from deploy url in case url is embeded using Iframe. * chore: remove copy issue link option if clipboard write access is not granted. --------- Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
29 lines
741 B
TypeScript
29 lines
741 B
TypeScript
import { useState, useEffect } from "react";
|
|
|
|
const useClipboardWritePermission = () => {
|
|
const [isClipboardWriteAllowed, setClipboardWriteAllowed] = useState(false);
|
|
|
|
useEffect(() => {
|
|
const checkClipboardWriteAccess = () => {
|
|
navigator.permissions
|
|
.query({ name: "clipboard-write" as PermissionName })
|
|
.then((result) => {
|
|
if (result.state === "granted") {
|
|
setClipboardWriteAllowed(true);
|
|
} else {
|
|
setClipboardWriteAllowed(false);
|
|
}
|
|
})
|
|
.catch(() => {
|
|
setClipboardWriteAllowed(false);
|
|
});
|
|
};
|
|
|
|
checkClipboardWriteAccess();
|
|
}, []);
|
|
|
|
return isClipboardWriteAllowed;
|
|
};
|
|
|
|
export default useClipboardWritePermission;
|