Skip to content

Commit

Permalink
Fix minor permission issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmi committed Mar 9, 2024
1 parent 4254c47 commit 77e481e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
13 changes: 11 additions & 2 deletions src/hooks/useFullScreen.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import React from "react";
import { FullScreen, useFullScreenHandle } from "react-full-screen";
import { useTranslation } from "react-i18next";
import { toast } from "react-toastify";

export const FullScreenContext = React.createContext({});

export const FullScreenProvider = ({ children }) => {
const { t } = useTranslation();
const handle = useFullScreenHandle();

const toggleFullScreen = React.useCallback(() => {
handle.active ? handle.exit() : handle.enter();
}, [handle]);
try {
handle.active ? handle.exit() : handle.enter();
} catch (e) {
toast.info(t("You don't have the permissions to go fullscreen"), {
autoClose: 1000,
});
}
}, [handle, t]);

return (
<FullScreen handle={handle}>
Expand Down
10 changes: 8 additions & 2 deletions src/views/BoardView/WelcomeModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ const WelcomeModal = ({ show, setShow, welcome = true }) => {
const currentUrl = window.location.href;

const handleCopy = async () => {
await navigator.clipboard.writeText(window.location.href);
toast.info(t("Url copied to clipboard!"), { autoClose: 1000 });
try {
await navigator.clipboard.writeText(window.location.href);
toast.info(t("Url copied to clipboard!"), { autoClose: 1000 });
} catch (e) {
toast.info(t("You don't have the permissions to copy the Url"), {
autoClose: 1000,
});
}
};

return (
Expand Down

1 comment on commit 77e481e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.