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,7 +26,10 @@ 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.
|
||||||
|
const mutation = useMutation(
|
||||||
|
(locale: LocaleCode) => client.updateAccountLanguage(locale ? locale : 'en'),
|
||||||
|
{
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
queryClient.invalidateQueries('account');
|
queryClient.invalidateQueries('account');
|
||||||
handleClose();
|
handleClose();
|
||||||
@ -34,7 +37,8 @@ const LanguageMenu = (): React.ReactElement => {
|
|||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
console.error(`Unexpected error ${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