Skip to content

Commit

Permalink
wip: focus window before navigating
Browse files Browse the repository at this point in the history
this aims to fix issue from
#1815

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
  • Loading branch information
lidel committed Jun 23, 2021
1 parent 97f92e9 commit abe0c0d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/webui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ module.exports = async function (ctx) {
url.searchParams.set('deviceId', ctx.countlyDeviceId)

ctx.launchWebUI = (path, { focus = true, forceRefresh = false } = {}) => {
if (focus) {
window.show()
window.focus()
dock.show()
}
if (forceRefresh) window.webContents.reload()
if (!path) {
logger.info('[web ui] launching web ui')
Expand All @@ -110,12 +115,6 @@ module.exports = async function (ctx) {
window.webContents.send('updatedPage', path)
url.hash = path
}

if (focus) {
window.show()
window.focus()
dock.show()
}
}

function updateLanguage () {
Expand Down

0 comments on commit abe0c0d

Please sign in to comment.