chore: space folders (#8707)
* chore: change the space folders structure * fix: format
This commit is contained in:
parent
be8836642a
commit
7fb6696c67
154 changed files with 30 additions and 197 deletions
35
apps/space/hooks/use-clipboard-write-permission.tsx
Normal file
35
apps/space/hooks/use-clipboard-write-permission.tsx
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/**
|
||||
* Copyright (c) 2023-present Plane Software, Inc. and contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue