Skip to content

Commit

Permalink
Add default values if no windows are returned
Browse files Browse the repository at this point in the history
  • Loading branch information
larsjohnsen committed Sep 17, 2024
1 parent 688bed6 commit d3fc80e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/environment/background/permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function makePromptWindow({ permissions, origins }) {
const height = 255;

// Get the current window's dimensions and calculate center position
const { width: screenWidth, height: screenHeight } = await chrome.windows.getCurrent();
const { width: screenWidth, height: screenHeight } = await chrome.windows.getCurrent() || { width: 1920, height: 1080 };
const left = Math.floor(screenWidth / 2 - width / 2);
const top = Math.floor(screenHeight / 2 - height / 2);

Expand Down

0 comments on commit d3fc80e

Please sign in to comment.