Skip to content

Commit

Permalink
Fix approach for loading window minimization on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
ZIMkaRU committed Jan 17, 2025
1 parent 524b0d9 commit ae8fbd6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/window-creators/layouts/app-init.html
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@

minBtnElem.onclick = async () => {
try {
await window.bfxReportElectronApi?.minimizeLoadingWin()
await window.bfxReportElectronApi?.hideLoadingWindow()
} catch (err) {
console.error(err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,23 @@ const wins = require('../windows')
const IpcChannelHandlers = require('./ipc.channel.handlers')

class GeneralIpcChannelHandlers extends IpcChannelHandlers {
#hideLoadingWindow = null

constructor (...args) {
super(...args)

// Resolve circular dependency issue
this.#hideLoadingWindow = require(
'../change-loading-win-visibility-state'
).hideLoadingWindow
}

async exitHandler (event, args) {
return app.exit(args?.code ?? 0)
}

async minimizeLoadingWinHandler (event, args) {
return wins.loadingWindow?.minimize()
async hideLoadingWindowHandler (event, args) {
await this.#hideLoadingWindow()
}

async getTitleHandler (event, args) {
Expand Down
2 changes: 1 addition & 1 deletion src/window-creators/main-renderer-ipc-bridge/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const CHANNEL_NAMES = {

const GENERAL_INVOKE_METHOD_NAMES = {
EXIT: 'exit',
MINIMIZE_LOADING_WIN: 'minimizeLoadingWin',
HIDE_LOADING_WINDOW: 'hideLoadingWindow',
GET_TITLE: 'getTitle'
}
const GENERAL_EVENT_METHOD_NAMES = {
Expand Down

0 comments on commit ae8fbd6

Please sign in to comment.