Fix interested state for anonymous accounts
The EventCard logic assume interestedIds not being present means the account can't set events as interested. Fix this logic by checking if the account is valid instead and always have interestedIds present on the account store.
This commit is contained in:
parent
04b9707272
commit
2cb56247be
2 changed files with 6 additions and 6 deletions
|
@ -9,7 +9,7 @@ export const useAccountStore = defineStore("account", () => {
|
|||
name: ref<string>(),
|
||||
timezone: ref<string>(),
|
||||
type: ref<Account["type"]>(),
|
||||
interestedIds: ref<Set<string>>(),
|
||||
interestedIds: ref<Set<string>>(new Set()),
|
||||
};
|
||||
|
||||
watchEffect(() => {
|
||||
|
@ -19,7 +19,7 @@ export const useAccountStore = defineStore("account", () => {
|
|||
state.name.value = account?.name;
|
||||
state.timezone.value = account?.timezone;
|
||||
state.type.value = account?.type;
|
||||
state.interestedIds.value = account?.interestedIds ? new Set(account.interestedIds) : undefined;
|
||||
state.interestedIds.value = new Set(account?.interestedIds ?? []);
|
||||
});
|
||||
|
||||
const getters = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue