mirror of
https://github.com/open-webui/open-webui
synced 2025-02-23 05:38:41 +00:00
refac
This commit is contained in:
parent
70a5be08c7
commit
16ce8ab16c
@ -284,14 +284,16 @@ export const updateUserInfo = async (token: string, info: object) => {
|
||||
|
||||
export const getAndUpdateUserLocation = async (token: string) => {
|
||||
const location = await getUserPosition().catch((err) => {
|
||||
throw err;
|
||||
console.log(err);
|
||||
return null;
|
||||
});
|
||||
|
||||
if (location) {
|
||||
await updateUserInfo(token, { location: location });
|
||||
return location;
|
||||
} else {
|
||||
throw new Error('Failed to get user location');
|
||||
console.log('Failed to get user location');
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user