mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-22 00:06:16 +08:00
optional chaining
This commit is contained in:
parent
632d615e38
commit
595d24ec56
|
@ -108,7 +108,7 @@ function buildQuoteSearchResult(
|
|||
lengthDesc = "thicc";
|
||||
}
|
||||
|
||||
const loggedOut = !Auth.currentUser;
|
||||
const loggedOut = !Auth?.currentUser;
|
||||
const isFav = !loggedOut && QuotesController.isQuoteFavorite(quote);
|
||||
|
||||
return `
|
||||
|
@ -193,7 +193,7 @@ export async function show(clearText = true): Promise<void> {
|
|||
|
||||
const quoteSearchInputValue = $("#quoteSearchPopup input").val() as string;
|
||||
|
||||
if (!Auth.currentUser) {
|
||||
if (!Auth?.currentUser) {
|
||||
$("#quoteSearchPopup #gotoSubmitQuoteButton").addClass("hidden");
|
||||
$("#quoteSearchPopup #toggleShowFavorites").addClass("hidden");
|
||||
} else {
|
||||
|
@ -385,7 +385,7 @@ $(document).on("click", "#quoteSearchPopup .textButton.favorite", async (e) => {
|
|||
});
|
||||
|
||||
$(document).on("click", "#toggleShowFavorites", (e) => {
|
||||
if (!Auth.currentUser) {
|
||||
if (!Auth?.currentUser) {
|
||||
// Notifications.add("You need to be logged in to use this feature!", 0);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue