From 562eb64e12047cb3a4ef5db2e9df19f9a726ae7c Mon Sep 17 00:00:00 2001 From: davfsa Date: Mon, 20 Jan 2025 06:24:35 +0100 Subject: [PATCH] Fix weather api call when query has multiple spaces (#731) --- src/globals/weather.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/globals/weather.ts b/src/globals/weather.ts index 5daa1d9..239a92f 100644 --- a/src/globals/weather.ts +++ b/src/globals/weather.ts @@ -33,7 +33,7 @@ const getWeatherKey = (apiKey: string): string => { const fileContent = new TextDecoder().decode(fileContentArray); if (!fileContent) { - console.error('File content is empty'); + console.error('weather_api_key file is empty'); return ''; } @@ -69,7 +69,7 @@ const weatherIntervalFn = (weatherInterval: number, loc: string, weatherKey: str weatherIntervalInstance.cancel(); } - const formattedLocation = loc.replace(' ', '%20'); + const formattedLocation = loc.replaceAll(' ', '%20'); weatherIntervalInstance = interval(weatherInterval, () => { execAsync(