Merge branch 'develop'

This commit is contained in:
Alice Gaudon 2020-01-21 21:28:46 +01:00
commit 607949e5fc
2 changed files with 7 additions and 3 deletions

View File

@ -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",

View File

@ -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());
}
}