Skip to content

Commit

Permalink
Check permissionStatus; use console.warn
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwasserman authored Feb 22, 2024
1 parent 8846c15 commit 5cb337a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function showWarning(text) {
const warning = document.getElementById('warning');
if (warning && warning.innerHTML !== text) {
if (text)
console.error(text);
console.warn(text);
warning.hidden = !text;
warning.innerHTML = text;
}
Expand Down Expand Up @@ -50,7 +50,7 @@ async function getScreenDetailsWithWarningAndFallback(requestPermission = false)
showWarning(); // Clear any warning.
else if (screenDetails && screenDetails.screens.length == 1)
showWarning("Please extend your desktop over multiple screens for full demo functionality");
else if (requestPermission || permissionStatus.state === 'denied')
else if (requestPermission || (permissionStatus && permissionStatus.state === 'denied'))
showWarning("Please allow the Window Management permission for full demo functionality");

if (screenDetails) {
Expand Down

0 comments on commit 5cb337a

Please sign in to comment.