mirror of
https://github.com/yang991178/fluent-reader.git
synced 2025-04-14 10:22:04 +02:00
fix article switch after loading full content
This commit is contained in:
parent
2bba8621ac
commit
efb704c597
@ -30,6 +30,8 @@ mac:
|
|||||||
- nl
|
- nl
|
||||||
- ko
|
- ko
|
||||||
- ru
|
- ru
|
||||||
|
- pt_BR
|
||||||
|
- pt_PT
|
||||||
minimumSystemVersion: 10.14.0
|
minimumSystemVersion: 10.14.0
|
||||||
mas:
|
mas:
|
||||||
entitlements: build/entitlements.mas.plist
|
entitlements: build/entitlements.mas.plist
|
||||||
|
@ -27,6 +27,8 @@ mac:
|
|||||||
- nl
|
- nl
|
||||||
- ko
|
- ko
|
||||||
- ru
|
- ru
|
||||||
|
- pt_BR
|
||||||
|
- pt_PT
|
||||||
win:
|
win:
|
||||||
target:
|
target:
|
||||||
- nsis
|
- nsis
|
||||||
@ -51,6 +53,8 @@ appx:
|
|||||||
- nl
|
- nl
|
||||||
- ko
|
- ko
|
||||||
- ru
|
- ru
|
||||||
|
- pt-BR
|
||||||
|
- pt-PT
|
||||||
showNameOnTiles: true
|
showNameOnTiles: true
|
||||||
setBuildNumber: true
|
setBuildNumber: true
|
||||||
nsis:
|
nsis:
|
||||||
|
@ -328,17 +328,22 @@ class Article extends React.Component<ArticleProps, ArticleState> {
|
|||||||
}
|
}
|
||||||
loadFull = async () => {
|
loadFull = async () => {
|
||||||
this.setState({ fullContent: "", loaded: false, error: false })
|
this.setState({ fullContent: "", loaded: false, error: false })
|
||||||
|
const link = this.props.item.link
|
||||||
try {
|
try {
|
||||||
const result = await fetch(this.props.item.link)
|
const result = await fetch(link)
|
||||||
if (!result || !result.ok) throw new Error()
|
if (!result || !result.ok) throw new Error()
|
||||||
const html = await decodeFetchResponse(result, true)
|
const html = await decodeFetchResponse(result, true)
|
||||||
this.setState({ fullContent: html })
|
if (link === this.props.item.link) {
|
||||||
|
this.setState({ fullContent: html })
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
this.setState({
|
if (link === this.props.item.link) {
|
||||||
loaded: true,
|
this.setState({
|
||||||
error: true,
|
loaded: true,
|
||||||
errorDescription: "MERCURY_PARSER_FAILURE",
|
error: true,
|
||||||
})
|
errorDescription: "MERCURY_PARSER_FAILURE",
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -467,7 +472,8 @@ class Article extends React.Component<ArticleProps, ArticleState> {
|
|||||||
className={this.state.error ? "error" : ""}
|
className={this.state.error ? "error" : ""}
|
||||||
key={
|
key={
|
||||||
this.props.item._id +
|
this.props.item._id +
|
||||||
(this.state.loadWebpage ? "_" : "")
|
(this.state.loadWebpage ? "_" : "") +
|
||||||
|
(this.state.loadFull ? "__" : "")
|
||||||
}
|
}
|
||||||
src={
|
src={
|
||||||
this.state.loadWebpage
|
this.state.loadWebpage
|
||||||
|
@ -135,6 +135,7 @@ class AppTab extends React.Component<AppTabProps, AppTabState> {
|
|||||||
{ key: "it", text: "Italiano" },
|
{ key: "it", text: "Italiano" },
|
||||||
{ key: "nl", text: "Nederlands" },
|
{ key: "nl", text: "Nederlands" },
|
||||||
{ key: "pt-BR", text: "Português do Brasil" },
|
{ key: "pt-BR", text: "Português do Brasil" },
|
||||||
|
{ key: "pt-PT", text: "Português de Portugal" },
|
||||||
{ key: "fi-FI", text: "Suomi" },
|
{ key: "fi-FI", text: "Suomi" },
|
||||||
{ key: "sv", text: "Svenska" },
|
{ key: "sv", text: "Svenska" },
|
||||||
{ key: "tr", text: "Türkçe" },
|
{ key: "tr", text: "Türkçe" },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user