Skip to content

Commit

Permalink
Re-add missing type guard
Browse files Browse the repository at this point in the history
Lost when merging forward #16481
  • Loading branch information
mvdbeek committed Jul 29, 2023
1 parent fa64fc6 commit e775edf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/src/stores/userStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const useUserStore = defineStore("userStore", () => {
}

async function setCurrentTheme(theme: string) {
if (!currentUser.value) {
if (!currentUser.value || currentUser.value.isAnonymous) {
return;
}
const currentTheme = await setCurrentThemeQuery(currentUser.value.id, theme);
Expand All @@ -88,15 +88,15 @@ export const useUserStore = defineStore("userStore", () => {
}
}
async function addFavoriteTool(toolId: string) {
if (!currentUser.value) {
if (!currentUser.value || currentUser.value.isAnonymous) {
return;
}
const tools = await addFavoriteToolQuery(currentUser.value.id, toolId);
setFavoriteTools(tools);
}

async function removeFavoriteTool(toolId: string) {
if (!currentUser.value) {
if (!currentUser.value || currentUser.value.isAnonymous) {
return;
}
const tools = await removeFavoriteToolQuery(currentUser.value.id, toolId);
Expand Down

0 comments on commit e775edf

Please sign in to comment.