mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1070430 - Resolve races with tab projects. r=paul
This commit is contained in:
parent
65c5e9792a
commit
47c61a8ef9
@ -134,13 +134,15 @@ let UI = {
|
||||
this.updateCommands();
|
||||
break;
|
||||
case "project":
|
||||
this.updateTitle();
|
||||
this.destroyToolbox();
|
||||
this.updateCommands();
|
||||
this.updateProjectButton();
|
||||
this.openProject();
|
||||
this.autoStartProject();
|
||||
break;
|
||||
this._updatePromise = Task.spawn(function() {
|
||||
UI.updateTitle();
|
||||
yield UI.destroyToolbox();
|
||||
UI.updateCommands();
|
||||
UI.updateProjectButton();
|
||||
UI.openProject();
|
||||
UI.autoStartProject();
|
||||
});
|
||||
return;
|
||||
case "project-is-not-running":
|
||||
case "project-is-running":
|
||||
case "list-tabs-response":
|
||||
@ -159,6 +161,7 @@ let UI = {
|
||||
case "install-progress":
|
||||
this.updateProgress(Math.round(100 * details.bytesSent / details.totalBytes));
|
||||
};
|
||||
this._updatePromise = promise.resolve();
|
||||
},
|
||||
|
||||
openInBrowser: function(url) {
|
||||
@ -717,11 +720,12 @@ let UI = {
|
||||
|
||||
destroyToolbox: function() {
|
||||
if (this.toolboxPromise) {
|
||||
this.toolboxPromise.then(toolbox => {
|
||||
return this.toolboxPromise.then(toolbox => {
|
||||
toolbox.destroy();
|
||||
this.toolboxPromise = null;
|
||||
}, console.error);
|
||||
}
|
||||
return promise.resolve();
|
||||
},
|
||||
|
||||
createToolbox: function() {
|
||||
|
@ -122,7 +122,11 @@ TabStore.prototype = {
|
||||
return this._selectedTab;
|
||||
},
|
||||
set selectedTab(tab) {
|
||||
if (this._selectedTab === tab) {
|
||||
return;
|
||||
}
|
||||
this._selectedTab = tab;
|
||||
this._selectedTabTargetPromise = null;
|
||||
// Attach to the tab to follow navigation events
|
||||
if (this._selectedTab) {
|
||||
this.getTargetForTab();
|
||||
@ -160,6 +164,11 @@ TabStore.prototype = {
|
||||
chrome: false
|
||||
});
|
||||
});
|
||||
this._selectedTabTargetPromise.then(target => {
|
||||
target.once("close", () => {
|
||||
this._selectedTabTargetPromise = null;
|
||||
});
|
||||
});
|
||||
return this._selectedTabTargetPromise;
|
||||
},
|
||||
|
||||
|
@ -110,7 +110,7 @@ function waitForUpdate(win, update) {
|
||||
return;
|
||||
}
|
||||
win.AppManager.off("app-manager-update", onUpdate);
|
||||
deferred.resolve();
|
||||
deferred.resolve(win.UI._updatePromise);
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user