Skip to content

Commit

Permalink
Merge pull request #403 from FuelRats/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleClapton authored Aug 7, 2023
2 parents 7373bce + 72b5808 commit 59c8e78
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
12 changes: 1 addition & 11 deletions src/components/Forms/AddRatForm/AddRatForm.js
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -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) => {
Expand All @@ -39,14 +37,6 @@ function AddRatForm () {
platform,
expansion: platform === 'pc' ? expansion : 'horizons3',
},
relationships: {
user: {
data: {
type: 'users',
id: userId,
},
},
},
}))
setFormOpen(false)
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function Header () {
icon={['fab', 'github']}
title="Fuel Rats on GitHub" />
<SocialIcon
href="https://forums.frontier.co.uk/showthread.php/150703-Out-of-Fuel-Explorer-Rescue-Service-The-Fuel-Rats"
href="https://forums.frontier.co.uk/threads/out-of-fuel-explorer-rescue-service-the-fuel-rats.150703/"
icon="space-shuttle"
title="Fuel Rats on Frontier Forums"
transform={{ rotate: -45 }} />
Expand Down
10 changes: 8 additions & 2 deletions src/pages/[slug].js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { HttpStatus } from '@fuelrats/web-util/http'
import { isError } from 'flux-standard-action'

import WordpressPage from '~/components/WordpressPage'
Expand All @@ -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)
}
}

Expand Down
11 changes: 10 additions & 1 deletion src/pages/api/apple-app-site-association.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
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: [{
appIDs: ['9X89US848J.io.sorlie.Fuel-Rats'],
components: [{
'/': '/verify*',
comment: 'used for handling password reset links in emails',
}],
}],
},
webcredentials: {
apps: ['9X89US848J.io.sorlie.Fuel-Rats'],
},
Expand Down

0 comments on commit 59c8e78

Please sign in to comment.