Skip to content

Commit

Permalink
Merge pull request #4849 from thematters/develop
Browse files Browse the repository at this point in the history
Release: v5.6.2
  • Loading branch information
wlliaml authored Sep 4, 2024
2 parents 893e241 + ed6efd3 commit 9b01898
Show file tree
Hide file tree
Showing 26 changed files with 288 additions and 159 deletions.
19 changes: 12 additions & 7 deletions lang/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
"/usqHn": {
"defaultMessage": "{displayName}'s creative space"
},
"/vyhs5": {
"defaultMessage": "Comment deleted",
"description": "src/components/Notice/NoticeComment.tsx"
},
"/wKyxw": {
"defaultMessage": "Failed to republish"
},
Expand Down Expand Up @@ -618,6 +614,10 @@
"defaultMessage": "Still quiet here. {br}Be the first one to say hello!",
"description": "src/components/Empty/EmptyComment.tsx"
},
"7zn5ig": {
"defaultMessage": "Comment deleted",
"description": "src/components/Notice/NoticeComment.tsx/article"
},
"8+Z5E9": {
"defaultMessage": "The badge signifies your participation and completion in the \"Free Write in 7 days\"."
},
Expand Down Expand Up @@ -889,6 +889,10 @@
"defaultMessage": "Copy comment",
"description": "src/components/Comment/DropdownActions/index.tsx"
},
"Ci7dxf": {
"defaultMessage": "Comment deleted",
"description": "src/components/Notice/NoticeComment.tsx/moment"
},
"CjKqYk": {
"defaultMessage": "Share a story from your life"
},
Expand Down Expand Up @@ -1486,9 +1490,6 @@
"N6PWfU": {
"defaultMessage": "Forget Password"
},
"N8ISx8": {
"defaultMessage": "Oops! This comment has been deleted by author"
},
"NACY16": {
"defaultMessage": "Why need to set up a wallet?",
"description": "src/components/Forms/PaymentForm/BindWallet/index.tsx"
Expand Down Expand Up @@ -3531,6 +3532,10 @@
"z3uIHQ": {
"defaultMessage": "Undo upvote"
},
"z91BKe": {
"defaultMessage": "Archived Work",
"description": "src/components/Notice/NoticeArticleTitle.tsx"
},
"zAK5G+": {
"defaultMessage": "The login link has been sent to {email}",
"description": "src/components/Forms/Verification/LinkSent.tsx"
Expand Down
19 changes: 12 additions & 7 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
"/usqHn": {
"defaultMessage": "{displayName}'s creative space"
},
"/vyhs5": {
"defaultMessage": "Comment deleted",
"description": "src/components/Notice/NoticeComment.tsx"
},
"/wKyxw": {
"defaultMessage": "Failed to republish"
},
Expand Down Expand Up @@ -618,6 +614,10 @@
"defaultMessage": "Still quiet here. {br}Be the first one to say hello!",
"description": "src/components/Empty/EmptyComment.tsx"
},
"7zn5ig": {
"defaultMessage": "Comment deleted",
"description": "src/components/Notice/NoticeComment.tsx/article"
},
"8+Z5E9": {
"defaultMessage": "The badge signifies your participation and completion in the \"Free Write in 7 days\"."
},
Expand Down Expand Up @@ -889,6 +889,10 @@
"defaultMessage": "Copy comment",
"description": "src/components/Comment/DropdownActions/index.tsx"
},
"Ci7dxf": {
"defaultMessage": "Comment deleted",
"description": "src/components/Notice/NoticeComment.tsx/moment"
},
"CjKqYk": {
"defaultMessage": "Share a story from your life"
},
Expand Down Expand Up @@ -1486,9 +1490,6 @@
"N6PWfU": {
"defaultMessage": "Forget Password"
},
"N8ISx8": {
"defaultMessage": "Oops! This comment has been deleted by author"
},
"NACY16": {
"defaultMessage": "Why need to set up a wallet?",
"description": "src/components/Forms/PaymentForm/BindWallet/index.tsx"
Expand Down Expand Up @@ -3531,6 +3532,10 @@
"z3uIHQ": {
"defaultMessage": "Undo upvote"
},
"z91BKe": {
"defaultMessage": "Archived Work",
"description": "src/components/Notice/NoticeArticleTitle.tsx"
},
"zAK5G+": {
"defaultMessage": "The login link has been sent to {email}",
"description": "src/components/Forms/Verification/LinkSent.tsx"
Expand Down
19 changes: 12 additions & 7 deletions lang/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
"/usqHn": {
"defaultMessage": "{displayName} 的创作空间站"
},
"/vyhs5": {
"defaultMessage": "留言已删除",
"description": "src/components/Notice/NoticeComment.tsx"
},
"/wKyxw": {
"defaultMessage": "发布失败"
},
Expand Down Expand Up @@ -618,6 +614,10 @@
"defaultMessage": "暂无评论",
"description": "src/components/Empty/EmptyComment.tsx"
},
"7zn5ig": {
"defaultMessage": "评论已删除",
"description": "src/components/Notice/NoticeComment.tsx/article"
},
"8+Z5E9": {
"defaultMessage": "纪念你参与「七日书」并完成七天书写"
},
Expand Down Expand Up @@ -889,6 +889,10 @@
"defaultMessage": "复制留言",
"description": "src/components/Comment/DropdownActions/index.tsx"
},
"Ci7dxf": {
"defaultMessage": "留言已删除",
"description": "src/components/Notice/NoticeComment.tsx/moment"
},
"CjKqYk": {
"defaultMessage": "分享今天开心或难过的小故事吧"
},
Expand Down Expand Up @@ -1486,9 +1490,6 @@
"N6PWfU": {
"defaultMessage": "忘记密码"
},
"N8ISx8": {
"defaultMessage": "Oops!该评论已被原作者删除"
},
"NACY16": {
"defaultMessage": "为什么需要设定钱包 ?",
"description": "src/components/Forms/PaymentForm/BindWallet/index.tsx"
Expand Down Expand Up @@ -3531,6 +3532,10 @@
"z3uIHQ": {
"defaultMessage": "取消点赞"
},
"z91BKe": {
"defaultMessage": "已归档作品",
"description": "src/components/Notice/NoticeArticleTitle.tsx"
},
"zAK5G+": {
"defaultMessage": "登录链接已发送至 {email}",
"description": "src/components/Forms/Verification/LinkSent.tsx"
Expand Down
19 changes: 12 additions & 7 deletions lang/zh-Hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
"/usqHn": {
"defaultMessage": "{displayName} 的創作空間站"
},
"/vyhs5": {
"defaultMessage": "留言已刪除",
"description": "src/components/Notice/NoticeComment.tsx"
},
"/wKyxw": {
"defaultMessage": "發布失敗"
},
Expand Down Expand Up @@ -618,6 +614,10 @@
"defaultMessage": "暫無評論",
"description": "src/components/Empty/EmptyComment.tsx"
},
"7zn5ig": {
"defaultMessage": "評論已刪除",
"description": "src/components/Notice/NoticeComment.tsx/article"
},
"8+Z5E9": {
"defaultMessage": "紀念你參與「七日書」並完成七天書寫"
},
Expand Down Expand Up @@ -889,6 +889,10 @@
"defaultMessage": "複製留言",
"description": "src/components/Comment/DropdownActions/index.tsx"
},
"Ci7dxf": {
"defaultMessage": "留言已刪除",
"description": "src/components/Notice/NoticeComment.tsx/moment"
},
"CjKqYk": {
"defaultMessage": "分享今天開心或難過的小故事吧"
},
Expand Down Expand Up @@ -1486,9 +1490,6 @@
"N6PWfU": {
"defaultMessage": "忘記密碼"
},
"N8ISx8": {
"defaultMessage": "Oops!該評論已被原作者刪除"
},
"NACY16": {
"defaultMessage": "為什麼需要設定錢包 ?",
"description": "src/components/Forms/PaymentForm/BindWallet/index.tsx"
Expand Down Expand Up @@ -3531,6 +3532,10 @@
"z3uIHQ": {
"defaultMessage": "取消點讚"
},
"z91BKe": {
"defaultMessage": "已封存作品",
"description": "src/components/Notice/NoticeArticleTitle.tsx"
},
"zAK5G+": {
"defaultMessage": "登入連結已發送至 {email}",
"description": "src/components/Forms/Verification/LinkSent.tsx"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "matters-web",
"version": "5.6.1",
"version": "5.6.2",
"description": "codebase of Matters' website",
"author": "Matters <[email protected]>",
"engines": {
Expand Down
1 change: 1 addition & 0 deletions src/components/Comment/FooterActions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const fragments = {
id
isBlocking
}
commentCount
}
... on Moment {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ import {
SpinnerBlock,
useEventListener,
useMutation,
useRoute,
ViewerContext,
} from '~/components'
import { PUT_ARTICLE_COMMENT } from '~/components/GQL/mutations/putComment'
import {
updateArticleComments,
updateArticlePublic,
updateCommentDetail,
} from '~/components/GQL/updates'
import { PutArticleCommentMutation } from '~/gql/graphql'
Expand Down Expand Up @@ -54,8 +52,6 @@ const CommentForm: React.FC<CommentFormProps> = ({
}) => {
const viewer = useContext(ViewerContext)
const formRef = useRef<HTMLFormElement>(null)
const { getQuery, routerLang } = useRoute()
const shortHash = getQuery('shortHash')

const [putComment] =
useMutation<PutArticleCommentMutation>(PUT_ARTICLE_COMMENT)
Expand Down Expand Up @@ -120,22 +116,6 @@ const CommentForm: React.FC<CommentFormProps> = ({
comment: mutationResult.data?.putComment,
})
}

if (!!parentId) {
updateArticlePublic({
cache,
shortHash,
routerLang,
type: 'addSecondaryComment',
})
} else {
updateArticlePublic({
cache,
shortHash,
routerLang,
type: 'addComment',
})
}
},
})

Expand Down
25 changes: 10 additions & 15 deletions src/components/Dialogs/MomentDetailDialog/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useQuery } from '@apollo/react-hooks'
import { Editor } from '@matters/matters-editor'
import classNames from 'classnames'
import { useEffect, useState } from 'react'
import { FormattedMessage } from 'react-intl'

import {
ADD_MOMENT_COMMENT_MENTION,
Expand Down Expand Up @@ -95,24 +94,20 @@ const MomentDetailDialogContent = ({
}

if (error) {
return <QueryError error={error} />
}

if (data?.moment?.__typename !== 'Moment') {
return null
return (
<section className={styles.error}>
<QueryError error={error} />
</section>
)
}

if (data.moment.state === MomentState.Archived) {
if (
data?.moment?.__typename !== 'Moment' ||
data.moment.state === MomentState.Archived
) {
return (
<section className={styles.error}>
<Error
message={
<FormattedMessage
defaultMessage="Hmm... It seems the author has hidden this work. Go see something else"
id="qhVSGI"
/>
}
>
<Error type="not_found">
<BackToHomeButton />
</Error>
</section>
Expand Down
1 change: 1 addition & 0 deletions src/components/Drawer/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
flex-direction: column;
padding: 0 var(--sp48);
overflow-y: auto;
overscroll-behavior: contain;
visibility: hidden;
background: white;
box-shadow: -8px 0 56px 0 rgb(0 0 0 / 8%) !important;
Expand Down
3 changes: 3 additions & 0 deletions src/components/Editor/Comment/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface Props {
onFocused?: () => void
isFallbackEditor?: boolean
lockScroll?: boolean
editable?: boolean
}

const CommentEditor: React.FC<Props> = ({
Expand All @@ -41,6 +42,7 @@ const CommentEditor: React.FC<Props> = ({
onFocused,
isFallbackEditor,
lockScroll = true,
editable = true,
}) => {
const client = useApolloClient()
const intl = useIntl()
Expand All @@ -54,6 +56,7 @@ const CommentEditor: React.FC<Props> = ({
})

const editor = useEditor({
editable,
content: content || '',
onUpdate: async ({ editor, transaction }) => {
const content = editor.getHTML()
Expand Down
16 changes: 6 additions & 10 deletions src/components/Editor/SetCover/Uploader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
ASSET_TYPE,
ENTITY_TYPE,
} from '~/common/enums'
import { sleep, validateImage } from '~/common/utils'
import { validateImage } from '~/common/utils'
import {
DraftDetailStateContext,
Icon,
Expand Down Expand Up @@ -55,13 +55,14 @@ const Uploader: React.FC<UploaderProps> = ({

const [upload, { loading }] = useMutation<DirectImageUploadMutation>(
DIRECT_IMAGE_UPLOAD,
undefined,
{ showToast: false }
)
const [directImageUploadDone] = useMutation<DirectImageUploadDoneMutation>(
DIRECT_IMAGE_UPLOAD_DONE,
{
update: async (cache, { data }) => {
if (data?.directImageUpload) {
// FIXME: newly uploaded images will return 404 in a short time
// https://community.cloudflare.com/t/new-uploaded-images-need-about-10-min-to-display-in-my-website/121568
await sleep(300)

updateDraftAssets({
cache,
id: entityId,
Expand All @@ -72,11 +73,6 @@ const Uploader: React.FC<UploaderProps> = ({
},
{ showToast: false }
)
const [directImageUploadDone] = useMutation<DirectImageUploadDoneMutation>(
DIRECT_IMAGE_UPLOAD_DONE,
undefined,
{ showToast: false }
)
const { upload: uploadImage, uploading } = useDirectImageUpload()

const { isInPath } = useRoute()
Expand Down
Loading

0 comments on commit 9b01898

Please sign in to comment.