optional chaining

This commit is contained in:
Miodec 2022-09-27 22:11:35 +02:00
parent 16c7750a01
commit 4582c3bdad
2 changed files with 3 additions and 3 deletions

View file

@ -18,7 +18,7 @@ type AxiosClientMethods = AxiosClientMethod & AxiosClientDataMethod;
async function adaptRequestOptions(
options: Ape.RequestOptions
): Promise<AxiosRequestConfig> {
const currentUser = Auth.currentUser;
const currentUser = Auth?.currentUser;
const idToken = currentUser && (await getIdToken(currentUser));
return {

View file

@ -110,7 +110,7 @@ export async function show(): Promise<void> {
"easeOutCubic"
);
if (Auth.currentUser) {
if (Auth?.currentUser) {
$("#alertsPopup .accountAlerts").removeClass("hidden");
$("#alertsPopup .separator.accountSeparator").removeClass("hidden");
$("#alertsPopup .accountAlerts .list").html(`
@ -134,7 +134,7 @@ export async function show(): Promise<void> {
},
100,
() => {
if (Auth.currentUser) {
if (Auth?.currentUser) {
getAccountAlerts();
}
}