diff --git a/package.json b/package.json index 5cd60fc..d1e30c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "thatconference.com", - "version": "5.2.1", + "version": "5.2.2", "description": "THATConference.com website", "main": "index.js", "type": "module", diff --git a/src/_components/activityCenter/ActivitySlideOver.svelte b/src/_components/activityCenter/ActivitySlideOver.svelte deleted file mode 100644 index 669ab1b..0000000 --- a/src/_components/activityCenter/ActivitySlideOver.svelte +++ /dev/null @@ -1,59 +0,0 @@ - - - -
- - - -

Activity Center

-
- -
- -
- -
- -
-
diff --git a/src/_components/footer/Footer.svelte b/src/_components/footer/Footer.svelte index aa5d324..961930e 100644 --- a/src/_components/footer/Footer.svelte +++ b/src/_components/footer/Footer.svelte @@ -39,7 +39,7 @@ {/each} -
+
@@ -143,7 +143,10 @@

© {dayjs().format('YYYY')} THAT® All rights reserved.
- v{version} + v.{version.substring(0, 7)}

diff --git a/src/lib/stores/notificationCenter.js b/src/lib/stores/notificationCenter.js deleted file mode 100644 index c32913e..0000000 --- a/src/lib/stores/notificationCenter.js +++ /dev/null @@ -1,13 +0,0 @@ -import { writable } from 'svelte/store'; - -export const hasNotifications = writable(false); -export const messages = writable([]); - -// todo.. is this a memory leak? -messages.subscribe((value) => { - if (value.length > 0) { - hasNotifications.set(true); - } else { - hasNotifications.set(false); - } -}); diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 15c2e4c..e4a142d 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -4,7 +4,7 @@ import '../app.css'; import { onMount, setContext } from 'svelte'; - import { navigating, page } from '$app/stores'; + import { navigating, page, updated } from '$app/stores'; import { beforeNavigate } from '$app/navigation'; import { browser, dev } from '$app/environment'; @@ -13,8 +13,6 @@ import { getFlash } from 'sveltekit-flash-message/client'; import loading from '$lib/stores/loading'; - import { showReleaseNotes } from '$lib/stores/siteVersion'; - import { messages } from '$lib/stores/notificationCenter'; import cart from '$lib/cart'; import claimTicket from '$lib/claimTicket'; @@ -32,8 +30,13 @@ const { isEmpty } = lodash; const flash = getFlash(page); - beforeNavigate((nav) => { - if ($flash && nav.from?.url.toString() !== nav.to?.url.toString()) { + beforeNavigate(({ willUnload, to, from }) => { + // https://kit.svelte.dev/docs/configuration#version + if ($updated && !willUnload && to?.url) { + location.href = to.url.href; + } + + if ($flash && from?.url.toString() !== to?.url.toString()) { $flash = undefined; } }); @@ -52,21 +55,11 @@ onMount(() => { if (window.grecaptcha) { /* eslint-disable no-undef */ - grecaptcha.enterprise.ready(async () => { + window.grecaptcha.enterprise.ready(async () => { /* eslint-disable no-undef */ - await grecaptcha.enterprise.execute(recaptcha.siteKey, { action: 'site_load' }); + await window.grecaptcha.enterprise.execute(recaptcha.siteKey, { action: 'site_load' }); }); } - - if ($showReleaseNotes) { - messages.update((m) => [ - ...m, - { - message: '🙌 We shipped again! 🎉 Check out newest features on thatconference.com!!!', - url: '/releases/changelog-missed' - } - ]); - } }); $: if (!isEmpty(data.user.profile)) { diff --git a/svelte.config.js b/svelte.config.js index 902eecf..3e10e43 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -2,6 +2,7 @@ import adapter from '@sveltejs/adapter-auto'; import preprocess from 'svelte-preprocess'; import { resolve } from 'path'; import { mdsvex } from 'mdsvex'; +import * as child_process from 'node:child_process'; import mdsvexConfig from './mdsvex.config.js'; @@ -21,7 +22,9 @@ const config = { $dataSources: resolve('./src/_dataSources') }, version: { - name: process.env?.npm_package_version || '0.0.0' + // name: process.env?.npm_package_version || '0.0.0' + // Changing this based on https://kit.svelte.dev/docs/configuration#version + name: child_process.execSync('git rev-parse HEAD').toString().trim() } }, preprocess: !dev