diff options
Diffstat (limited to 'src/index.html')
-rw-r--r-- | src/index.html | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/index.html b/src/index.html index f29aa2686..198c1ab7b 100644 --- a/src/index.html +++ b/src/index.html | |||
@@ -35,11 +35,16 @@ | |||
35 | const originalReloadBehaviour = window._onLiveReloadFileChanged; | 35 | const originalReloadBehaviour = window._onLiveReloadFileChanged; |
36 | 36 | ||
37 | window._onLiveReloadFileChanged = (file) => { | 37 | window._onLiveReloadFileChanged = (file) => { |
38 | if (!file.path.includes('/build/webview/') && !file.path.includes('/build/index.js') && !file.path.includes('/build/electron/')) { | 38 | const isTodoPreloadPath = file.path.includes('/build/features/todos/preload.js'); |
39 | if (!file.path.includes('/build/webview/') && !file.path.includes('/build/index.js') && !file.path.includes('/build/electron/') && !isTodoPreloadPath) { | ||
39 | originalReloadBehaviour(file); | 40 | originalReloadBehaviour(file); |
40 | } else { | 41 | } else { |
41 | if (file.path.includes('/build/webview/')) { | 42 | if (isTodoPreloadPath) { |
42 | debug('Livereload: Reloading all webvies'); | 43 | debug('Livereload: Reloading all webviews'); |
44 | const webview = document.querySelector('webview[partition="persist:todos"]'); | ||
45 | if (webview) webview.reload(); | ||
46 | } else if (file.path.includes('/build/webview/')) { | ||
47 | debug('Livereload: Reloading all webviews'); | ||
43 | const webviews = document.querySelectorAll('webview').forEach(webview => webview.reload()); | 48 | const webviews = document.querySelectorAll('webview').forEach(webview => webview.reload()); |
44 | } else { | 49 | } else { |
45 | debug('Livereload: skip reload as only main process files have changed'); | 50 | debug('Livereload: skip reload as only main process files have changed'); |