Skip to content

Instantly share code, notes, and snippets.

@sebastianwagner
Created July 2, 2013 15:16
Show Gist options
  • Save sebastianwagner/5910174 to your computer and use it in GitHub Desktop.
Save sebastianwagner/5910174 to your computer and use it in GitHub Desktop.
Fix gnome3 js fuckup in bluetooth component throwing errors when logging in.
diff --git a/bluetooth.js b/bluetooth.js
index f6d2f30..8af2fd3 100644
--- a/bluetooth.js
+++ b/bluetooth.js
@@ -93,6 +93,7 @@ const Indicator = new Lang.Class({
},
_updateKillswitch: function() {
+ if(typeof GnomeBluetoothApplet == 'undefined' || typeof GnomeBluetoothApplet.killswitch_state == 'undefined') return;
let current_state = this._applet.killswitch_state;
let on = current_state == GnomeBluetoothApplet.KillswitchState.UNBLOCKED;
let has_adapter = current_state != GnomeBluetoothApplet.KillswitchState.NO_ADAPTER;
@sebastianwagner
Copy link
Author

Looks like this in .xession-errors:

    JS ERROR: !!!   Exception was: TypeError: GnomeBluetoothApplet.KillswitchState is undefined
    JS ERROR: !!!     message = '"GnomeBluetoothApplet.KillswitchState is undefined"'
    JS ERROR: !!!     fileName = '"/usr/share/gnome-shell/js/ui/status/bluetooth.js"'
    JS ERROR: !!!     lineNumber = '97'
    JS ERROR: !!!     stack = '"()@/usr/share/gnome-shell/js/ui/status/bluetooth.js:97
wrapper()@/usr/share/gjs-1.0/lang.js:204
()@/usr/share/gnome-shell/js/ui/status/bluetooth.js:56
wrapper()@/usr/share/gjs-1.0/lang.js:204
()@/usr/share/gjs-1.0/lang.js:145
()@/usr/share/gjs-1.0/lang.js:239
()@/usr/share/gnome-shell/js/ui/panel.js:1135
wrapper()@/usr/share/gjs-1.0/lang.js:204
start()@/usr/share/gnome-shell/js/ui/main.js:234
@<main>:1
"'
Fensterverwalter-Warnung:Log level 32: Execution of main.js threw exception: TypeError: GnomeBluetoothApplet.KillswitchState is undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment