may fix a bug
This commit is contained in:
+13
-7
@@ -212,10 +212,13 @@ export default class ICESpeedExtension extends Extension {
|
|||||||
/*
|
/*
|
||||||
* Only now do we create a repeating timer.
|
* Only now do we create a repeating timer.
|
||||||
*/
|
*/
|
||||||
this._timerId = GLib.timeout_add_seconds(
|
this._timerId = GLib.timeout_add(
|
||||||
GLib.PRIORITY_DEFAULT,
|
GLib.PRIORITY_DEFAULT,
|
||||||
UPDATE_INTERVAL_SECONDS,
|
UPDATE_INTERVAL_SECONDS * 1000,
|
||||||
() => {
|
() => {
|
||||||
|
if (!this._onIceWifi)
|
||||||
|
return GLib.SOURCE_REMOVE;
|
||||||
|
|
||||||
this._updateSpeed();
|
this._updateSpeed();
|
||||||
return GLib.SOURCE_CONTINUE;
|
return GLib.SOURCE_CONTINUE;
|
||||||
}
|
}
|
||||||
@@ -240,16 +243,19 @@ export default class ICESpeedExtension extends Extension {
|
|||||||
/*
|
/*
|
||||||
* Cancel an in-progress curl invocation.
|
* Cancel an in-progress curl invocation.
|
||||||
*/
|
*/
|
||||||
if (this._requestCancellable !== null)
|
const cancellable = this._requestCancellable;
|
||||||
this._requestCancellable.cancel();
|
const process = this._requestProcess;
|
||||||
|
|
||||||
if (this._requestProcess !== null)
|
|
||||||
this._requestProcess.force_exit();
|
|
||||||
|
|
||||||
this._requestCancellable = null;
|
this._requestCancellable = null;
|
||||||
this._requestProcess = null;
|
this._requestProcess = null;
|
||||||
this._requestRunning = false;
|
this._requestRunning = false;
|
||||||
|
|
||||||
|
if (cancellable !== null)
|
||||||
|
cancellable.cancel();
|
||||||
|
|
||||||
|
if (process !== null)
|
||||||
|
process.force_exit();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Completely disappear from panel.
|
* Completely disappear from panel.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user