Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-add missing type guard #16486

Merged
merged 1 commit into from
Jul 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading