diff --git a/package.json b/package.json index 80d6547..3f05a38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tabs", - "version": "0.4.0", + "version": "0.4.1", "description": "Persistent and separate browser tabs in one window", "author": { "name": "Alice Gaudon", diff --git a/resources/js/index.js b/resources/js/index.js index b59ec95..8699067 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -327,6 +327,8 @@ function setActiveService(serviceId) { function loadService(serviceId, service) { // Load service if not loaded yet if (!service.view && !service.viewReady) { + console.log('Loading service', serviceId); + document.querySelector('#services > .loader').classList.remove('hidden'); service.view = document.createElement('webview'); service.view.setAttribute('src', service.url); @@ -344,10 +346,11 @@ function loadService(serviceId, service) { } document.querySelector('#services > .loader').classList.add('hidden'); - updateNavigation(); service.li.classList.add('loaded'); service.viewReady = true; + updateNavigation(); + if (selectedService === null) { setActiveService(serviceId); } @@ -398,6 +401,7 @@ function unloadService(serviceId) { function reloadService(serviceId) { const service = services[serviceId]; if (service.view && service.viewReady) { + console.log('Reloading service', serviceId); document.querySelector('#services > .loader').classList.remove('hidden'); service.view.reload(); } else if (!service.view && !service.viewReady) { @@ -435,7 +439,7 @@ function updateNavigation() { function updateWindowTitle() { if (selectedService === null) { ipcRenderer.send('updateWindowTitle', null); - } else { + } else if(services[selectedService].viewReady) { ipcRenderer.send('updateWindowTitle', selectedService, services[selectedService].view.getWebContents().getTitle()); } }