Skip to content

Commit

Permalink
Fixed issue
Browse files Browse the repository at this point in the history
  • Loading branch information
qwreey committed Nov 6, 2022
1 parent 57de91d commit f4581f8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const Features = Me.imports.features
const { logger } = Me.imports.libs.utility
const { GLib } = imports.gi
var loaded
var timeout

// handling extension
function enable() {
Expand All @@ -21,7 +22,9 @@ function enable() {
new Features.buttonRemover.buttonRemoverFeature(settings)
]

this.timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 300, () => {
// Add timeout for waitting other extensions such as GSConnect
// This is necessary behavior due to ordering qs panel
timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 300, () => {
for (const feature of loaded) {
logger(`Loading feature '${feature.constructor.name}'`)
feature.load()
Expand All @@ -34,9 +37,9 @@ function enable() {
function disable() {
logger("Unloading ...")

if (this.timeout) {
GLib.Source.remove(this.timeout)
this.timeout = null
if (timeout) {
GLib.Source.remove(timeout)
timeout = null
}
if (!loaded) return
for (const feature of loaded) {
Expand Down

0 comments on commit f4581f8

Please sign in to comment.