client: disable theme transitions on change
This commit is contained in:
parent
6a4ff9c307
commit
de68796101
5 changed files with 15 additions and 4 deletions
|
@ -31,7 +31,7 @@ function MyApp({ Component, pageProps }: AppProps) {
|
|||
<meta name="theme-color" content="#ffffff" />
|
||||
<title>Drift</title>
|
||||
</Head>
|
||||
<ThemeProvider defaultTheme="system">
|
||||
<ThemeProvider defaultTheme="system" disableTransitionOnChange>
|
||||
<App Component={Component} pageProps={pageProps} />
|
||||
</ThemeProvider>
|
||||
</div>
|
||||
|
|
|
@ -11,6 +11,10 @@ const renderMarkdown: NextApiHandler = async (req, res) => {
|
|||
Authorization: `Bearer ${req.cookies["drift-token"]}`
|
||||
}
|
||||
})
|
||||
console.log(file.status)
|
||||
if (file.status !== 200) {
|
||||
return res.status(404).json({ error: "File not found" })
|
||||
}
|
||||
|
||||
const json = await file.json()
|
||||
const { content, title } = json
|
||||
|
|
|
@ -9,10 +9,12 @@ const getRawFile = async (req: NextApiRequest, res: NextApiResponse) => {
|
|||
Authorization: `Bearer ${req.cookies["drift-token"]}`
|
||||
}
|
||||
})
|
||||
const json = await file.json()
|
||||
|
||||
res.setHeader("Content-Type", "text/plain; charset=utf-8")
|
||||
res.setHeader("Cache-Control", "s-maxage=86400")
|
||||
if (file.ok) {
|
||||
const json = await file.json()
|
||||
console.log(json)
|
||||
const data = json
|
||||
const { title, content } = data
|
||||
// serve the file raw as plain text
|
||||
|
|
|
@ -16,8 +16,8 @@ article img {
|
|||
article [id]::before {
|
||||
content: "";
|
||||
display: block;
|
||||
height: 70px;
|
||||
margin-top: -70px;
|
||||
height: var(--gap-half);
|
||||
margin-top: calc(var(--gap-half) * -1);
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,11 @@ files.get("/raw/:id", secretKey, async (req, res, next) => {
|
|||
attributes: ["title", "content"],
|
||||
})
|
||||
|
||||
|
||||
if (!file) {
|
||||
return res.status(404).json({ error: "File not found" })
|
||||
}
|
||||
|
||||
// TODO: JWT-checkraw files
|
||||
if (file?.post?.visibility === "private") {
|
||||
// jwt(req as UserJwtRequest, res, () => {
|
||||
|
|
Loading…
Reference in a new issue