mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 06:37:56 +01:00
Add change location workaround.
This commit is contained in:
parent
fa5def64ca
commit
51a5b39129
@ -26,15 +26,19 @@ const LanguageMenu = (): React.ReactElement => {
|
||||
const open = Boolean(anchorEl);
|
||||
const intl = useIntl();
|
||||
|
||||
const mutation = useMutation((locale: LocaleCode) => client.updateAccountLanguage(locale), {
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries('account');
|
||||
handleClose();
|
||||
// Todo: For some reasons, in some situations locale is null. More research needed.
|
||||
const mutation = useMutation(
|
||||
(locale: LocaleCode) => client.updateAccountLanguage(locale ? locale : 'en'),
|
||||
{
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries('account');
|
||||
handleClose();
|
||||
},
|
||||
onError: (error) => {
|
||||
console.error(`Unexpected error ${error}`);
|
||||
},
|
||||
},
|
||||
onError: (error) => {
|
||||
console.error(`Unexpected error ${error}`);
|
||||
},
|
||||
});
|
||||
);
|
||||
|
||||
const handleMenu = (event: React.MouseEvent<HTMLElement>) => {
|
||||
setAnchorEl(event.currentTarget);
|
||||
|
Loading…
Reference in New Issue
Block a user