diff --git a/README.md b/README.md index abf0d601e..bbf2dc409 100644 --- a/README.md +++ b/README.md @@ -44,3 +44,11 @@ and will start a development server on port 3000. If you don't wish to run the backend locally (which most likely you don't), you can point your local frontend to the staging or production APIs by specifying a different `NODE_ENV`, such as `staging`. + +### Login + +Trying to log in on a locally hosted copy of the frontend will fail and redirect you to the live site +because of how the OAuth sign in process works. +To work around this, copy the `token` cookie produced by signing into the real site (`.ficsit.app`) +and add it to your cookies for `localhost`. +There is likely a cookie manager extension for your browser of choice that will make this easier. diff --git a/cspell.json b/cspell.json index 5f9d71d3e..c983299b4 100644 --- a/cspell.json +++ b/cspell.json @@ -5,7 +5,7 @@ // language - current active spelling language "language": "en", // words - list of words to be always considered correct - "words": ["cfworker", "felte", "prismjs", "smui", "urql", "wonka"], + "words": ["cfworker", "felte", "ficsit", "prismjs", "smui", "urql", "wonka"], // flagWords - list of words to be always considered incorrect // This is useful for offensive words and common spelling errors. // cSpell:disable (don't complain about the words we listed here) diff --git a/src/lib/components/mods/ModVersions.svelte b/src/lib/components/mods/ModVersions.svelte index 568b105a4..ca4ebc7b2 100644 --- a/src/lib/components/mods/ModVersions.svelte +++ b/src/lib/components/mods/ModVersions.svelte @@ -17,7 +17,7 @@ let expandedVersions = new Set(); // TODO Pagination - const versions = queryStore({ + $: versions = queryStore({ query: GetModVersionsDocument, client, variables: { diff --git a/src/routes/admin/sml-versions/[smlVersionId]/edit/+page.svelte b/src/routes/admin/sml-versions/[smlVersionId]/edit/+page.svelte index 464ea8f2f..a06e58f95 100644 --- a/src/routes/admin/sml-versions/[smlVersionId]/edit/+page.svelte +++ b/src/routes/admin/sml-versions/[smlVersionId]/edit/+page.svelte @@ -19,7 +19,7 @@ let errorMessage = ''; let errorToast = false; - const smlVersion = queryStore({ + $: smlVersion = queryStore({ query: GetSmlVersionAdminDocument, client, variables: { smlVersionID: smlVersionId } diff --git a/src/routes/guide/[guideId]/edit/+page.svelte b/src/routes/guide/[guideId]/edit/+page.svelte index e177aec6a..13e97f2b3 100644 --- a/src/routes/guide/[guideId]/edit/+page.svelte +++ b/src/routes/guide/[guideId]/edit/+page.svelte @@ -19,7 +19,7 @@ let errorMessage = ''; let errorToast = false; - const guide = queryStore({ + $: guide = queryStore({ query: GetGuideDocument, client, variables: { guide: guideId } diff --git a/src/routes/mod/[modId]/edit/+page.svelte b/src/routes/mod/[modId]/edit/+page.svelte index d06611236..2a8390c45 100644 --- a/src/routes/mod/[modId]/edit/+page.svelte +++ b/src/routes/mod/[modId]/edit/+page.svelte @@ -8,7 +8,6 @@ import { base } from '$app/paths'; import MetaDescriptors from '$lib/components/utils/MetaDescriptors.svelte'; import Card, { Content } from '@smui/card'; - import { get } from 'svelte/store'; import type { PageData } from './$types'; export let data: PageData; @@ -20,7 +19,7 @@ let errorMessage = ''; let errorToast = false; - const mod = queryStore({ + $: mod = queryStore({ query: GetModDocument, client, variables: { mod: modId } @@ -29,7 +28,7 @@ const onSubmit = (modData: ModData) => { client .mutation(EditModDocument, { - modId: get(mod).data.mod.id, + modId: $mod.data.mod.id, mod: modData }) .toPromise() diff --git a/src/routes/mod/[modId]/new-version/+page.svelte b/src/routes/mod/[modId]/new-version/+page.svelte index c3d809cd5..f747d01fe 100644 --- a/src/routes/mod/[modId]/new-version/+page.svelte +++ b/src/routes/mod/[modId]/new-version/+page.svelte @@ -39,7 +39,7 @@ let errorMessage = ''; let errorToast = false; - const mod = queryStore({ + $: mod = queryStore({ query: GetModReferenceDocument, client, variables: { mod: modId } diff --git a/src/routes/mod/[modId]/version/[versionId]/edit/+page.svelte b/src/routes/mod/[modId]/version/[versionId]/edit/+page.svelte index c576e6763..56caecb98 100644 --- a/src/routes/mod/[modId]/version/[versionId]/edit/+page.svelte +++ b/src/routes/mod/[modId]/version/[versionId]/edit/+page.svelte @@ -19,7 +19,7 @@ let errorMessage = ''; let errorToast = false; - const version = queryStore({ + $: version = queryStore({ query: GetModVersionDocument, client, variables: { version: versionId }