Skip to content

Commit

Permalink
locations: Create launchMaxWait in order
Browse files Browse the repository at this point in the history
Even though that's only used in a delayed promise, it's still better to
go in order.
  • Loading branch information
3v1n0 committed Feb 28, 2023
1 parent f914bbf commit 68041cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions locations.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ var LocationAppInfo = GObject.registerClass({
getHandlerApp(cancellable) {
cancellable = cancellable ?? new Utils.CancellableChild(this.cancellable);

if (this._launchMaxWaitIds === undefined)
this._launchMaxWaitIds = new Set();

// GVfs providers could hang when querying the file informations, so we
// workaround this by using the async API in a sync way, but we need to
// use a timeout to avoid this to hang forever, better than hang the
Expand All @@ -370,9 +373,6 @@ var LocationAppInfo = GObject.registerClass({
}),
]).then(h => (handler = h)).catch(e => (error = e));

if (this._launchMaxWaitIds === undefined)
this._launchMaxWaitIds = new Set();

while (handler === undefined && error === undefined)
GLib.MainContext.default().iteration(false);

Expand Down

0 comments on commit 68041cd

Please sign in to comment.