Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/electronmon.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ module.exports = ({

function startWatcher() {
return new Promise((resolve) => {
const watcher = watch({ root: cwd, patterns });
const parentFolder = cwd.replace("\\Host","")
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this? This is replacing part of a path? That seems odd and unintuitive.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my apologies, that was something for my own project and shouldn't have been part of this pull request, all other commits should be valid though

const watcher = watch({ root: parentFolder, patterns });
globalWatcher = watcher;

watcher.on('change', ({ path: fullpath }) => {
Expand Down
13 changes: 11 additions & 2 deletions src/hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,20 @@ function reload() {

if (windows && windows.length) {
for (const win of windows) {
win.webContents.reloadIgnoringCache();
if(win.isDestroyed() == false){
win.webContents.reloadIgnoringCache()

const views = win.getBrowserViews()
views.forEach(function(view){
if(view.webContents.isDestroyed() == false){
view.webContents.reloadIgnoringCache()
}
})
}

}
}
}

required.on('file', ({ type, id }) => {
if (type !== 'file') {
return;
Expand Down