Skip to content

Commit

Permalink
Fixed async issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sakithb committed Sep 3, 2021
1 parent 94c9fb1 commit 1ed0b08
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,25 @@ const enable = () => {
});

buttonNext.set_child(iconNext);
buttonNext.connect("button-release-event", () => playerAction(currentPlayer, "next"));
buttonNext.connect("button-release-event", () => {
(() => {
playerAction(currentPlayer, "next");
})();
});

buttonPrev.set_child(iconPrev);
buttonPrev.connect("button-release-event", () => playerAction(currentPlayer, "previous"));
buttonPrev.connect("button-release-event", () => {
(() => {
playerAction(currentPlayer, "previous");
})();
});

buttonToggle.set_child(iconPlay);
buttonToggle.connect("button-release-event", () => playerAction(currentPlayer, "toggle"));
buttonToggle.connect("button-release-event", () => {
(() => {
playerAction(currentPlayer, "toggle");
})();
});

buttonPlayer.set_child(iconPlayer);
buttonPlayer.connect("button-release-event", mouseAction);
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
],
"url": "https://github.com/cliffniff/media-controls",
"uuid": "[email protected]",
"version": 8
"version": 9
}

0 comments on commit 1ed0b08

Please sign in to comment.