Skip to content

Commit

Permalink
Merge pull request #16486 from mvdbeek/typeguard_fix
Browse files Browse the repository at this point in the history
Re-add missing type guard
  • Loading branch information
bgruening authored Jul 30, 2023
2 parents e6507fb + e775edf commit 58851af
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 58851af

Please sign in to comment.