Make sure old links still work in the dev-IdeWrapper

by making it case-insensitive, forcing it to lower case.
This commit is contained in:
Kurt Hutten
2021-07-18 19:50:39 +10:00
parent b0bdb2c6f6
commit 754436c79d
3 changed files with 2 additions and 3 deletions

View File

@@ -6,7 +6,6 @@ import IdeSideBar from 'src/components/IdeSideBar/IdeSideBar'
import IdeHeader from 'src/components/IdeHeader/IdeHeader'
import Svg from 'src/components/Svg/Svg'
import { useIdeInit } from 'src/components/EncodedUrl/helpers'
import type { Project } from 'src/components/IdeProjectCell/IdeProjectCell'
import { useIdeContext } from 'src/helpers/hooks/useIdeContext'
import { useSaveCode } from 'src/components/IdeWrapper/useSaveCode'

View File

@@ -18,7 +18,7 @@ export const useSaveCode = () => {
if (!!error !== nowError) {
setNowError(!!error)
}
if (project?.user?.id !== currentUser?.sub) {
if (!currentUser || project?.user?.id !== currentUser?.sub) {
return () => console.log('not your project')
}
return (input: Prisma.ProjectUpdateInput) => {