@@ -22,7 +22,7 @@ import {
22
22
23
23
// ----------------------- Extension -----------------------
24
24
export default class NoiseclapperExtension extends Extension {
25
- public settings = this . getSettings ( ) ;
25
+ public settings ?: Gio . Settings ;
26
26
private bluetoothClient ?: GnomeBluetooth . Client ;
27
27
private indicator ?: InstanceType < typeof NoiseclapperIndicator > ;
28
28
private settingsHandler ?: Gio . SettingsBindFlags ;
@@ -43,6 +43,7 @@ export default class NoiseclapperExtension extends Extension {
43
43
Main . panel . addToStatusArea ( this . uuid , this . indicator ) ;
44
44
45
45
// Apply settings and position
46
+ this . settings = this . getSettings ( ) ;
46
47
this . settingsHandler = this . settings . connect (
47
48
'changed' ,
48
49
this . applySettings . bind ( this ) ,
@@ -65,9 +66,11 @@ export default class NoiseclapperExtension extends Extension {
65
66
66
67
// Disconnect settings change handler
67
68
if ( this . settingsHandler !== undefined ) {
68
- this . settings . disconnect ( this . settingsHandler ) ;
69
+ this . settings ! . disconnect ( this . settingsHandler ) ;
69
70
this . settingsHandler = undefined ;
70
71
}
72
+
73
+ this . settings = undefined ;
71
74
}
72
75
73
76
signalHandler ( signal : string ) {
@@ -100,7 +103,7 @@ export default class NoiseclapperExtension extends Extension {
100
103
101
104
applySettings ( ) {
102
105
logIfEnabled ( LogType . Debug , 'Applying settings...' ) ;
103
- updateLogging ( this . settings . get_boolean ( 'logging-enabled' ) ) ;
106
+ updateLogging ( this . settings ! . get_boolean ( 'logging-enabled' ) ) ;
104
107
this . indicator ! . applyPosition ( ) ;
105
108
}
106
109
}
0 commit comments