diff options
Diffstat (limited to 'src/index.html')
-rw-r--r-- | src/index.html | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/index.html b/src/index.html index bf15e2d4e..198c1ab7b 100644 --- a/src/index.html +++ b/src/index.html | |||
@@ -10,6 +10,7 @@ | |||
10 | <div class="window-draggable"></div> | 10 | <div class="window-draggable"></div> |
11 | <div class="dev-warning">DEV MODE</div> | 11 | <div class="dev-warning">DEV MODE</div> |
12 | <div id="root"></div> | 12 | <div id="root"></div> |
13 | <div id="portalContainer"></div> | ||
13 | <script> | 14 | <script> |
14 | document.querySelector('body').classList.add(process.env.OS_PLATFORM ? process.env.OS_PLATFORM : process.platform); | 15 | document.querySelector('body').classList.add(process.env.OS_PLATFORM ? process.env.OS_PLATFORM : process.platform); |
15 | 16 | ||
@@ -34,11 +35,16 @@ | |||
34 | const originalReloadBehaviour = window._onLiveReloadFileChanged; | 35 | const originalReloadBehaviour = window._onLiveReloadFileChanged; |
35 | 36 | ||
36 | window._onLiveReloadFileChanged = (file) => { | 37 | window._onLiveReloadFileChanged = (file) => { |
37 | 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) { | ||
38 | originalReloadBehaviour(file); | 40 | originalReloadBehaviour(file); |
39 | } else { | 41 | } else { |
40 | if (file.path.includes('/build/webview/')) { | 42 | if (isTodoPreloadPath) { |
41 | 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'); | ||
42 | const webviews = document.querySelectorAll('webview').forEach(webview => webview.reload()); | 48 | const webviews = document.querySelectorAll('webview').forEach(webview => webview.reload()); |
43 | } else { | 49 | } else { |
44 | debug('Livereload: skip reload as only main process files have changed'); | 50 | debug('Livereload: skip reload as only main process files have changed'); |