From 777d22f288645b048c86c14e19a507980940edd9 Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 27 Sep 2022 22:20:05 +0200 Subject: [PATCH] optional chaining --- frontend/src/ts/settings/theme-picker.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/ts/settings/theme-picker.ts b/frontend/src/ts/settings/theme-picker.ts index b5d3626f2..cd5a1bb3a 100644 --- a/frontend/src/ts/settings/theme-picker.ts +++ b/frontend/src/ts/settings/theme-picker.ts @@ -110,7 +110,7 @@ export async function refreshButtons(): Promise { ).empty(); const addButton = $(".pageSettings .section.themes .addCustomThemeButton"); - if (Auth.currentUser === null) { + if (!Auth?.currentUser) { $( ".pageSettings .section.themes .customThemeEdit .saveCustomThemeButton" ).text("save"); @@ -430,7 +430,7 @@ $("#shareCustomThemeButton").on("click", () => { $(".pageSettings .saveCustomThemeButton").on("click", async () => { saveCustomThemeColors(); - if (Auth.currentUser) { + if (Auth?.currentUser) { const newCustomTheme = { name: "custom", colors: Config.customThemeColors,