Fix some type errors.
This commit is contained in:
@@ -24,7 +24,7 @@ import { ChatCircleText } from 'phosphor-react'
|
|||||||
TimeAgo.setDefaultLocale(en.locale)
|
TimeAgo.setDefaultLocale(en.locale)
|
||||||
TimeAgo.addLocale(en)
|
TimeAgo.addLocale(en)
|
||||||
|
|
||||||
function MyApp({ Component, pageProps: { session, ...pageProps } }: AppProps) {
|
function MyApp({ Component, pageProps: { session, ...pageProps } }: AppProps<{ session?: any }>) {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const slug = router.query?.slug
|
const slug = router.query?.slug
|
||||||
const gistId = (Array.isArray(slug) && slug[0]) ?? null
|
const gistId = (Array.isArray(slug) && slug[0]) ?? null
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Octokit } from '@octokit/core'
|
import { Octokit } from '@octokit/core'
|
||||||
import state, { IFile } from '../index'
|
import state, { IFile, ILang } from '../index'
|
||||||
import { templateFileIds } from '../constants'
|
import { templateFileIds } from '../constants'
|
||||||
|
|
||||||
const octokit = new Octokit()
|
const octokit = new Octokit()
|
||||||
@@ -48,7 +48,7 @@ export const fetchFiles = async (gistId: string) => {
|
|||||||
|
|
||||||
const files: IFile[] = Object.keys(res.data.files).map(filename => ({
|
const files: IFile[] = Object.keys(res.data.files).map(filename => ({
|
||||||
name: res.data.files?.[filename]?.filename || 'untitled.c',
|
name: res.data.files?.[filename]?.filename || 'untitled.c',
|
||||||
language: res.data.files?.[filename]?.language?.toLowerCase() || '',
|
language: res.data.files?.[filename]?.language?.toLowerCase() as ILang | undefined,
|
||||||
content: res.data.files?.[filename]?.content || ''
|
content: res.data.files?.[filename]?.content || ''
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user