Skip to content

Commit

Permalink
Fix view toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Miess committed Sep 22, 2023
1 parent 60d04a9 commit 6701ae5
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,22 @@ class AllIPAddressIndicator extends PanelMenu.Button{
this._updateLabel();
}

_toggleView(){
console.log("Updating label for all-ip extension")
if (type===4) {
type=6;
} else if (type===6) {
type=0;
} else if (type===0){
type=1;
} else if (type===1){
type=4
}
this._updateLabel();
}

_updateLabel(){
console.log("Updating label for all-ip extension")
if (type===4) {
type=6;
} else if (type===6) {
type=0;
} else if (type===0){
type=1;
} else if (type===1){
type=4
}

const refreshTime = 2 // in seconds
const refreshTime = 20 // in seconds

if (this._timeout) {
GLib.source_remove(this._timeout);
Expand Down Expand Up @@ -187,7 +190,7 @@ export default class AllIPAddressExtension extends Extension {
enable() {
this._indicator = new AllIPAddressIndicator();
Main.panel.addToStatusArea('all-ip-addresses-indicator', this._indicator);
this._indicator.connect('button-press-event', this._indicator._updateLabel());
this._indicator.connect('button-press-event', () => this._indicator._toggleView());
}

disable() {
Expand Down

0 comments on commit 6701ae5

Please sign in to comment.