Skip to content

Commit

Permalink
fix: workaround for 1660564 in some cases lead to blank sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
mbnuqw committed Feb 27, 2024
1 parent 7415d15 commit 2c8641f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/services/windows.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export async function loadWindowInfo(): Promise<void> {
const currentWindow = winData[0]
let uniqWinId = winData[1] as string | undefined

// Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1660564
if (currentWindow.type !== 'normal') {
throw 'This code should not be launched in a window with a type other than "normal"'
}

// Generate unique window id
if (!uniqWinId) {
uniqWinId = Utils.uid()
Expand Down
4 changes: 0 additions & 4 deletions src/sidebar/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ import { Snapshots } from 'src/services/snapshots'
import { updateWebReqHandlers } from 'src/services/web-req.fg'
import { initUpgrading, showUpgradingScreen } from 'src/services/upgrading'

if (document.body.offsetHeight === 0 && document.body.offsetWidth === 0) {
throw 'Sidebar: Not enough space: 0px / 0px'
}

async function main(): Promise<void> {
Info.setInstanceType(InstanceType.sidebar)
IPC.setInstanceType(InstanceType.sidebar)
Expand Down

0 comments on commit 2c8641f

Please sign in to comment.