From 23bd0a52e9d8553783064e81184e480228a30f05 Mon Sep 17 00:00:00 2001 From: "Alex S. Glomsaas" Date: Sat, 11 Feb 2023 17:44:26 +0100 Subject: [PATCH 1/5] Add support for IOS deeplinking --- src/pages/api/apple-app-site-association.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pages/api/apple-app-site-association.js b/src/pages/api/apple-app-site-association.js index 4a6008a9..a918d142 100644 --- a/src/pages/api/apple-app-site-association.js +++ b/src/pages/api/apple-app-site-association.js @@ -5,6 +5,15 @@ import { HttpStatus } from '@fuelrats/web-util/http' */ export default function appleAppSiteAssociation (req, res) { res.status(HttpStatus.OK).json({ + appLinks: { + details: [ + appIDs: ['9X89US848J.io.sorlie.Fuel-Rats'], + components: [{ + '/': '/verify*', + 'comment': 'used for handling password reset links in emails', + }], + ], + }, webcredentials: { apps: ['9X89US848J.io.sorlie.Fuel-Rats'], }, From ef74dc2522b3caa47c8c7a1b6ea5d673d4c72608 Mon Sep 17 00:00:00 2001 From: Peter253545 <58088721+Peter253545@users.noreply.github.com> Date: Mon, 12 Jun 2023 09:05:59 +0000 Subject: [PATCH 2/5] Fix dead link --- src/components/Header/Header.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Header/Header.js b/src/components/Header/Header.js index 514eba92..b061f238 100644 --- a/src/components/Header/Header.js +++ b/src/components/Header/Header.js @@ -154,7 +154,7 @@ function Header () { icon={['fab', 'github']} title="Fuel Rats on GitHub" /> From 862758c5c7ff71ce9dd349d5c947b34756dfa9c1 Mon Sep 17 00:00:00 2001 From: Peter253545 <58088721+Peter253545@users.noreply.github.com> Date: Tue, 20 Jun 2023 10:24:57 +0100 Subject: [PATCH 3/5] Fix format of apple-app-site-association. --- src/pages/api/apple-app-site-association.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/api/apple-app-site-association.js b/src/pages/api/apple-app-site-association.js index a918d142..93a3720a 100644 --- a/src/pages/api/apple-app-site-association.js +++ b/src/pages/api/apple-app-site-association.js @@ -1,18 +1,18 @@ import { HttpStatus } from '@fuelrats/web-util/http' /* - * Almost always redirected from '/apple-app-site-Association' + * Almost always rewritten from '/.well-known/apple-app-site-Association' */ export default function appleAppSiteAssociation (req, res) { res.status(HttpStatus.OK).json({ appLinks: { - details: [ + details: [{ appIDs: ['9X89US848J.io.sorlie.Fuel-Rats'], components: [{ '/': '/verify*', - 'comment': 'used for handling password reset links in emails', + comment: 'used for handling password reset links in emails', }], - ], + }], }, webcredentials: { apps: ['9X89US848J.io.sorlie.Fuel-Rats'], From 3ae3dbdb77935d1dbeb60b6d8b10abacb6da18db Mon Sep 17 00:00:00 2001 From: Peter253545 <58088721+Peter253545@users.noreply.github.com> Date: Tue, 20 Jun 2023 11:09:46 +0100 Subject: [PATCH 4/5] Fix /[slug].js route to show a 404 when a page is not found on wordpress, rather than a 200. --- src/pages/[slug].js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pages/[slug].js b/src/pages/[slug].js index f6fefb09..0027f5f0 100644 --- a/src/pages/[slug].js +++ b/src/pages/[slug].js @@ -1,3 +1,4 @@ +import { HttpStatus } from '@fuelrats/web-util/http' import { isError } from 'flux-standard-action' import WordpressPage from '~/components/WordpressPage' @@ -19,9 +20,14 @@ WordpressProxy.getInitialProps = async (ctx) => { if (!selectWordpressPageBySlug(store.getState(), { slug })) { const response = await store.dispatch(getWordpressPage(slug)) - if (isError(response)) { - setError(ctx, response.meta?.response?.status) + if (!isError(response)) { + return } + if (!response.payload?.length) { + setError(ctx, HttpStatus.NOT_FOUND) + return + } + setError(ctx, response.meta?.response?.status) } } From 4d5a2ce954027f1c2fbf5eed13bdb96b9effa5ff Mon Sep 17 00:00:00 2001 From: Peter253545 <58088721+Peter253545@users.noreply.github.com> Date: Sun, 2 Jul 2023 18:42:37 +0100 Subject: [PATCH 5/5] fix: remove redundant `relationships` when creating a rat. --- src/components/Forms/AddRatForm/AddRatForm.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/components/Forms/AddRatForm/AddRatForm.js b/src/components/Forms/AddRatForm/AddRatForm.js index 2f8f2dbe..ee442516 100644 --- a/src/components/Forms/AddRatForm/AddRatForm.js +++ b/src/components/Forms/AddRatForm/AddRatForm.js @@ -1,13 +1,12 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { useCallback, useState } from 'react' -import { useDispatch, useSelector } from 'react-redux' +import { useDispatch } from 'react-redux' import CMDRFieldset from '~/components/Fieldsets/CMDRFieldset' import ExpansionFieldset from '~/components/Fieldsets/ExpansionFieldset' import SelectFieldset from '~/components/Fieldsets/SelectFieldset' import useForm from '~/hooks/useForm' import { createRat } from '~/store/actions/rats' -import { selectCurrentUserId } from '~/store/selectors' import styles from './AddRatForm.module.scss' @@ -23,7 +22,6 @@ const initialState = { function AddRatForm () { const dispatch = useDispatch() - const userId = useSelector(selectCurrentUserId) const [formOpen, setFormOpen] = useState(false) const handleToggleForm = useCallback(() => { setFormOpen((state) => { @@ -39,14 +37,6 @@ function AddRatForm () { platform, expansion: platform === 'pc' ? expansion : 'horizons3', }, - relationships: { - user: { - data: { - type: 'users', - id: userId, - }, - }, - }, })) setFormOpen(false) }