Skip to content

Commit

Permalink
fix: #118
Browse files Browse the repository at this point in the history
  • Loading branch information
theClarkSell committed Oct 20, 2023
1 parent 8cb03aa commit 8adb6b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "thatconference.com",
"version": "5.1.4",
"version": "5.1.5",
"description": "THATConference.com website",
"main": "index.js",
"type": "module",
Expand Down
14 changes: 5 additions & 9 deletions src/lib/stores/favorites.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { writable } from 'svelte/store';
import { page } from '$app/stores';
import { browser } from '$app/environment';
import { page } from '$app/stores';

import favoritesQueryApi from '$dataSources/api.that.tech/me/favorites/queries';
import favoritesMutationsApi from '$dataSources/api.that.tech/me/favorites/mutations';
Expand Down Expand Up @@ -28,15 +28,11 @@ export async function toggle(sessionId, eventId) {
return results;
}

async function create() {
const initalValues = await get();
favoritesStore.set(initalValues);
}

if (browser) {
page.subscribe((values) => {
if (values?.data?.user?.profile) {
create();
page.subscribe(async (values) => {
if (values?.data?.user?.isAuthenticated) {
const initalValues = await get();
favoritesStore.set(initalValues);
}
});
}
Expand Down

0 comments on commit 8adb6b2

Please sign in to comment.