Use more concise syntax for optional function call

This commit is contained in:
Daniel Abramov
2023-07-11 16:02:58 +01:00
parent e6047f8583
commit 333b7cc041
+1 -3
View File
@@ -48,9 +48,7 @@ export function UserMenuContainer({ preventNavigation = false }: Props) {
modalState.open();
break;
case "logout":
if (logout) {
logout();
}
logout?.();
break;
case "login":
history.push("/login", { state: { from: location } });