File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -220,8 +220,27 @@ export class WeatherApp {
220220 // Continue to fallback location
221221 }
222222
223- // Attempt 2: Fallback to Tehran (most reliable default)
224- console . log ( '[WeatherApp] Using Tehran as fallback location' ) ;
223+ // Attempt 2: Try fallback location using IP geolocation
224+ console . log ( '[WeatherApp] Attempting fallback location via IP geolocation...' ) ;
225+ try {
226+ const fallbackLocation = await this . geolocationManager . getFallbackLocation ( ) ;
227+ if ( fallbackLocation && fallbackLocation . lat && fallbackLocation . lon ) {
228+ console . log (
229+ `[WeatherApp] Fallback location found: ${ fallbackLocation . city || 'Unknown' } , ${ fallbackLocation . country } `
230+ ) ;
231+ await this . getWeatherByCoordinates ( fallbackLocation . lat , fallbackLocation . lon ) ;
232+ this . toast . showInfo (
233+ `🌤️ Weather loaded for ${ fallbackLocation . city || 'your location' } (via IP geolocation)`
234+ ) ;
235+ return ;
236+ }
237+ } catch ( fallbackError ) {
238+ console . warn ( '[WeatherApp] Fallback location failed:' , fallbackError . message ) ;
239+ }
240+
241+ // Attempt 3: Fallback to Tehran (most reliable default)
242+ console . log ( '[WeatherApp] Using Tehran as final fallback location' ) ;
243+
225244 await this . getWeatherByCoordinates ( 35.6892 , 51.389 ) ;
226245 this . toast . showInfo ( '🌤️ Weather loaded for Tehran (geolocation unavailable)' ) ;
227246 } catch ( error ) {
Original file line number Diff line number Diff line change @@ -201,7 +201,7 @@ export class SearchManager {
201201 container . style . display = 'block' ;
202202 container . style . opacity = '1' ;
203203 container . style . visibility = 'visible' ;
204- container . classList . add ( 'show' ) ;
204+ container . classList . add ( 'show' , '__web-inspector-hide-shortcut__' ) ;
205205
206206 console . log ( `[SearchManager] ✅ SHOWING ${ results . length } results` ) ;
207207
You can’t perform that action at this time.
0 commit comments