Fix weather api call when query has multiple spaces (#731)

This commit is contained in:
davfsa
2025-01-20 06:24:35 +01:00
committed by GitHub
parent 88609f7e4c
commit 562eb64e12

View File

@@ -33,7 +33,7 @@ const getWeatherKey = (apiKey: string): string => {
const fileContent = new TextDecoder().decode(fileContentArray); const fileContent = new TextDecoder().decode(fileContentArray);
if (!fileContent) { if (!fileContent) {
console.error('File content is empty'); console.error('weather_api_key file is empty');
return ''; return '';
} }
@@ -69,7 +69,7 @@ const weatherIntervalFn = (weatherInterval: number, loc: string, weatherKey: str
weatherIntervalInstance.cancel(); weatherIntervalInstance.cancel();
} }
const formattedLocation = loc.replace(' ', '%20'); const formattedLocation = loc.replaceAll(' ', '%20');
weatherIntervalInstance = interval(weatherInterval, () => { weatherIntervalInstance = interval(weatherInterval, () => {
execAsync( execAsync(