Use more concise syntax for optional function call

This commit is contained in:
Daniel Abramov
2023-07-03 18:26:11 +01:00
parent e6047f8583
commit 333b7cc041

View File

@@ -48,9 +48,7 @@ export function UserMenuContainer({ preventNavigation = false }: Props) {
modalState.open(); modalState.open();
break; break;
case "logout": case "logout":
if (logout) { logout?.();
logout();
}
break; break;
case "login": case "login":
history.push("/login", { state: { from: location } }); history.push("/login", { state: { from: location } });