Skip to content

Commit

Permalink
ToucheggClient: null timeoutId in a more clear way for extension review
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseExposito committed Oct 13, 2023
1 parent e2a54d2 commit 522ce38
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/touchegg/ToucheggClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,11 @@ const ToucheggClient = GObject.registerClass({
}

static async sleep(time) {
let timeoutId = await new Promise((resolve) => {
const ret = GLib.timeout_add(GLib.PRIORITY_DEFAULT, time, () => {
resolve(ret);
let timeoutId;

await new Promise((resolve) => {
timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, time, () => {
resolve();
return GLib.SOURCE_REMOVE;
});
});
Expand Down

0 comments on commit 522ce38

Please sign in to comment.