Skip to content

Commit

Permalink
chore: test vercel toolbox preview
Browse files Browse the repository at this point in the history
  • Loading branch information
mydearxym authored Mar 4, 2024
1 parent dc8350c commit 71d2595
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
# with:
# version: 1.4.1
- name: Run Biome
run: node_modules/.bin/biome ci ./src; ls -llh; pwd
run: node_modules/.bin/biome ci ./src
- name: (Frontend) Setup Config CMD Tools
working-directory: ./
run: ls -llh; chmod +x ./utils/bin/jq-linux; ./utils/bin/jq-linux -s '.[0] * .[1]' config/config.json config/config.ci.json > /tmp/config.json; cp /tmp/config.json ./config/config.json
Expand Down
1 change: 1 addition & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"suspicious": {
"noExplicitAny": "warn",
"noImplicitAnyLet": "warn",
"noAssignInExpressions": "warn",
"noDuplicateJsxProps": "error",
"noDuplicateObjectKeys": "error",
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/ArticleSettingMenu/Menu/PinItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { MenuItem } from '../styles/menu'
const PinItem: FC = () => {
const { article } = useViewingArticle()
const [result, pinPost] = useMutation(S.pinPost)
const [result2, undoPinPost] = useMutation(S.undoPinPost)
const [_result2, undoPinPost] = useMutation(S.undoPinPost)

const [pin, setPin] = useState(article.isPinned)

Expand Down
26 changes: 13 additions & 13 deletions src/widgets/ArticleSettingMenu/SubMenu/Mirror2Home.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { FC, useState, useEffect } from 'react'
import { FC } from 'react'
import { useMutation } from 'urql'

import useViewingArticle from '@/hooks/useViewingArticle'
// import { toast, updateViewingArticle } from '@/signal'
import { toast, updateViewingArticle } from '@/signal'

import S from '../schema'
import useTouched from '../useTouched'
Expand All @@ -22,17 +22,17 @@ const Mirrow2Home: FC<TProps> = ({ onBack }) => {
const handleUpdate = () => {
const params = { id: article.id }
console.log('## handle action')
// updatePost(params).then((result) => {
// if (result.error) {
// toast('修改失败', 'error')
// } else {
// toast('修改完成')
// const newTitle = result.data.updatePost.title
// setTitle(newTitle)
// updateViewingArticle({ id: article.id, title: newTitle })
// resetTouched()
// }
// })
updatePost(params).then((result) => {
if (result.error) {
toast('修改失败', 'error')
} else {
toast('修改完成')
const newTitle = result.data.updatePost.title
// setTitle(newTitle)
updateViewingArticle({ id: article.id, title: newTitle })
resetTouched()
}
})
}
return (
<Wrapper>
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/IllegalWarning/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ const IllegalWarning: FC<TProps> = ({ illegalReason, illegalWords }) => {
{illegalReason.map((reason, index) => (
<Fragment key={reason}>
<Reason>{reason}</Reason>
{index !== illegalReason.length - 1 && <></>}
{index !== illegalReason.length - 1 && <>|</>}
</Fragment>
))}
] 内容:
</Title>

<Content>
{illegalWords.map((word, index) => (
{illegalWords.map((word) => (
<IllegalItem key={word}>{word}</IllegalItem>
))}
</Content>
Expand Down
11 changes: 1 addition & 10 deletions src/widgets/MarkDownRender/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,7 @@ class MarkDownRender extends React.Component {
return (
<PreviewerContainer>
<MarkDownStyle>
<div className="markdown-body">
{/* eslint-disable react/no-danger */}
<div
id={contentDomId}
dangerouslySetInnerHTML={{
__html: html,
}}
/>
{/* eslint-enable react/no-danger */}
</div>
<div className="markdown-body">TODO</div>
</MarkDownStyle>
</PreviewerContainer>
)
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/OSSUploader/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const doUploadFile = (ossClient, file, filePrefix, callbacks): void => {
const url = `${ASSETS_ENDPOINT}/${result.name}`
callbacks.onDone(url)
})
.catch((err) => {
.catch((_err) => {
callbacks.onError('上传失败')
toast('文件上传失败')
// BStore.remove(STS.AK)
Expand Down

0 comments on commit 71d2595

Please sign in to comment.