Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Bug fix: crash when viewing 'mature content' without login #33

Merged
merged 2 commits into from
Feb 26, 2022

Conversation

celeron533
Copy link
Collaborator

Fix the crash when viewing 'mature content' without login
When not login, server will only return object data.errorinfo, no more extra elements.

前端萌新,react不熟。

* github actions: using `npm i` for android build
* fix repository settings in package.json
When not login, server will only return object `data.errorinfo`, no more extra elements.
@@ -18,9 +18,9 @@ const ArtDetail = (props) => {
return <div className='art-detail-page'>
<TitleBar />
{isViewerDisplay && <WxImageViewer onClose={() => setDisplay(false)} urls={[picSrc]} index={0}/>}
<img className='art-preview' onClick={() => setDisplay(true)} src={picSrc} />
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

图片永远都能成功读取,不论是不是mature

isLoading || <>
{!isLoading && data.success === true && <>
<img className='art-preview' onClick={() => setDisplay(true)} src={picSrc} />

<div className="art-info-title">{data.artwork.title}</div>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果本次entry时mature,data仅有内容:

'success' : true,
'errorinfo' : 'Please login ......'

data.artwork ,导致整个页面/android app 炸掉

@melchior-voidwolf melchior-voidwolf merged commit 0f55a09 into FurCoder:master Feb 26, 2022
@celeron533 celeron533 deleted the bug_fix branch February 28, 2022 12:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants