mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 14:47: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 open = Boolean(anchorEl);
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
|
||||||
const mutation = useMutation((locale: LocaleCode) => client.updateAccountLanguage(locale), {
|
// Todo: For some reasons, in some situations locale is null. More research needed.
|
||||||
onSuccess: () => {
|
const mutation = useMutation(
|
||||||
queryClient.invalidateQueries('account');
|
(locale: LocaleCode) => client.updateAccountLanguage(locale ? locale : 'en'),
|
||||||
handleClose();
|
{
|
||||||
|
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>) => {
|
const handleMenu = (event: React.MouseEvent<HTMLElement>) => {
|
||||||
setAnchorEl(event.currentTarget);
|
setAnchorEl(event.currentTarget);
|
||||||
|
Loading…
Reference in New Issue
Block a user