Handle no location permission

This commit is contained in:
Sebastian
2025-02-23 20:27:55 +01:00
parent 39717812ee
commit b00e14eb3f
2 changed files with 17 additions and 8 deletions

View File

@@ -74,7 +74,13 @@
}
if (command.content.includes('{{USER_LOCATION}}')) {
const location = await getUserPosition();
let location;
try {
location = await getUserPosition();
} catch (error) {
toast.error($i18n.t('Location access not allowed'));
location = 'LOCATION_UNKNOWN';
}
text = text.replaceAll('{{USER_LOCATION}}', String(location));
}