mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
Handle no location permission
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user