Skip to content

Commit

Permalink
feat: adding page polling and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
theClarkSell committed Dec 6, 2023
1 parent caf53a7 commit db2be4a
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 93 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.2.1",
"version": "5.2.2",
"description": "THATConference.com website",
"main": "index.js",
"type": "module",
Expand Down
59 changes: 0 additions & 59 deletions src/_components/activityCenter/ActivitySlideOver.svelte

This file was deleted.

7 changes: 5 additions & 2 deletions src/_components/footer/Footer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{/each}
</div>
</div>
<div class="col-span-2 mt-12 flex justify-end xl:mt-0 ">
<div class="col-span-2 mt-12 flex justify-end xl:mt-0">
<Newsletter />
</div>
</div>
Expand Down Expand Up @@ -143,7 +143,10 @@
<div class="mt-12 border-t border-gray-200 pt-8">
<p class="text-base text-gray-400 xl:text-center">
&copy; {dayjs().format('YYYY')} THAT&reg; All rights reserved.<br />
<em>v{version}</em>
<em
><a href={`https://github.com/thatconference/thatconference.com/commit/${version}`}
>v.{version.substring(0, 7)}</a
></em>
</p>
</div>
</div>
Expand Down
13 changes: 0 additions & 13 deletions src/lib/stores/notificationCenter.js

This file was deleted.

27 changes: 10 additions & 17 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand All @@ -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;
}
});
Expand All @@ -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)) {
Expand Down
5 changes: 4 additions & 1 deletion svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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
Expand Down

0 comments on commit db2be4a

Please sign in to comment.