Skip to content

Commit

Permalink
fix: show Files after import on windows
Browse files Browse the repository at this point in the history
this aims to fix issue from
#1815
  • Loading branch information
lidel committed Jun 24, 2021
1 parent 2a0268d commit f5f40d7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/add-to-ipfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ function sendNotification (failures, successes, launchWebUI, path) {
}

fn({ title, body }, () => {
// force refresh for Files screen to pick up newly added items
// https://github.com/ipfs/ipfs-desktop/issues/1763
launchWebUI(link, { forceRefresh: true })
})
}
Expand Down
3 changes: 1 addition & 2 deletions src/webui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,9 @@ module.exports = async function (ctx) {
logger.info('[web ui] launching web ui')
} else {
logger.info(`[web ui] navigate to ${path}`)
window.webContents.send('updatedPage', path)
url.hash = path
window.webContents.loadURL(url.toString())
}

if (focus) {
window.show()
window.focus()
Expand Down
7 changes: 2 additions & 5 deletions src/webui/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ const urlParams = new URLSearchParams(window.location.search)

function checkIfVisible () {
if (document.hidden) {
if (window.location.hash === '#/blank') return // skip, already blank
previousHash = window.location.hash
window.location.hash = '/blank'
} else {
if (previousHash === '#/blank') return // skip
window.location.hash = previousHash
}
}
Expand All @@ -28,11 +30,6 @@ window.localStorage.setItem = function () {

let previousHash = null

ipcRenderer.on('updatedPage', (_, url) => {
previousHash = url
window.location.hash = url
})

document.addEventListener('visibilitychange', () => {
checkIfVisible()
})
Expand Down

0 comments on commit f5f40d7

Please sign in to comment.