🐛 Fix default values for modules

The default value was not set correctly for modules. This has been fixed. It was also fixed in the Weather Module and the Date Module.
This commit is contained in:
Thomas Camlong
2022-06-28 12:10:46 +02:00
parent e93a3a3b5f
commit 41be0e6362
3 changed files with 16 additions and 7 deletions

View File

@@ -29,7 +29,7 @@ export const WeatherModule: IModule = {
},
location: {
name: 'Current location',
value: '',
value: 'Paris',
},
},
};
@@ -135,7 +135,7 @@ export default function WeatherComponent(props: any) {
const { config } = useConfig();
const [weather, setWeather] = useState({} as WeatherResponse);
const cityInput: string =
(config?.modules?.[WeatherModule.title]?.options?.location?.value as string) ?? '';
(config?.modules?.[WeatherModule.title]?.options?.location?.value as string) ?? 'Paris';
const isFahrenheit: boolean =
(config?.modules?.[WeatherModule.title]?.options?.freedomunit?.value as boolean) ?? false;