@@ -115,13 +115,7 @@ class BingWallpaperIndicator extends PanelMenu.Button {
115
115
// take a variety of actions when the gsettings values are modified by prefs
116
116
this . _settings = ExtensionUtils . getSettings ( Utils . BING_SCHEMA ) ;
117
117
118
- this . httpSession = new Soup . Session ( ) ;
119
- Soup . Session . prototype . add_feature . call ( this . httpSession , new Soup . ProxyResolverDefault ( ) ) ; // unclear if this is necessary
120
- if ( this . _settings . get_boolean ( 'debug-logging' ) ) {
121
- this . logger = Soup . Logger . new ( Soup . LoggerLogLevel . HEADERS , - 1 ) ;
122
- this . logger . attach ( this . httpSession ) ;
123
- this . logger . set_printer ( soupPrinter ) ;
124
- }
118
+ this . _initSoup ( ) ;
125
119
126
120
getActorCompat ( this ) . visible = ! this . _settings . get_boolean ( 'hide' ) ;
127
121
@@ -218,6 +212,16 @@ class BingWallpaperIndicator extends PanelMenu.Button {
218
212
}
219
213
}
220
214
215
+ _initSoup ( ) {
216
+ this . httpSession = new Soup . Session ( ) ;
217
+ Soup . Session . prototype . add_feature . call ( this . httpSession , new Soup . ProxyResolverDefault ( ) ) ; // unclear if this is necessary
218
+ if ( this . _settings . get_boolean ( 'debug-logging' ) ) {
219
+ this . logger = Soup . Logger . new ( Soup . LoggerLogLevel . HEADERS , - 1 ) ;
220
+ this . logger . attach ( this . httpSession ) ;
221
+ this . logger . set_printer ( soupPrinter ) ;
222
+ }
223
+ }
224
+
221
225
// listen for configuration changes
222
226
_setConnections ( ) {
223
227
this . _settings . connect ( 'changed::hide' , ( ) => {
@@ -487,6 +491,7 @@ class BingWallpaperIndicator extends PanelMenu.Button {
487
491
this . _updatePending = true ;
488
492
this . _restartTimeout ( ) ;
489
493
let market = this . _settings . get_string ( 'market' ) ;
494
+ this . _initSoup ( ) ; // get new session, incase we aren't detecting proxy changes
490
495
// create an http message
491
496
let url = BingImageURL + ( market != 'auto' ? market : '' ) ;
492
497
let request = Soup . Message . new ( 'GET' , url ) ;
0 commit comments