failing thread root load, show current note
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
1f4427641e
commit
23584205aa
@ -2,7 +2,7 @@ import "./Thread.css";
|
|||||||
|
|
||||||
import { EventExt, TaggedNostrEvent, u256 } from "@snort/system";
|
import { EventExt, TaggedNostrEvent, u256 } from "@snort/system";
|
||||||
import { ReactNode, useCallback, useContext, useMemo } from "react";
|
import { ReactNode, useCallback, useContext, useMemo } from "react";
|
||||||
import { useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
import BackButton from "@/Components/Button/BackButton";
|
import BackButton from "@/Components/Button/BackButton";
|
||||||
@ -72,6 +72,22 @@ export function Thread(props: { onBack?: () => void; disableSpotlight?: boolean
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function renderCurrent() {
|
||||||
|
if (thread.current) {
|
||||||
|
const note = thread.data.find(n => n.id === thread.current);
|
||||||
|
return (
|
||||||
|
note && (
|
||||||
|
<Note
|
||||||
|
data={note}
|
||||||
|
options={{ showReactionsLink: true, showMediaSpotlight: true }}
|
||||||
|
threadChains={thread.chains}
|
||||||
|
onClick={navigateThread}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function goBack() {
|
function goBack() {
|
||||||
if (parent) {
|
if (parent) {
|
||||||
thread.setCurrent(parent);
|
thread.setCurrent(parent);
|
||||||
@ -119,6 +135,12 @@ export function Thread(props: { onBack?: () => void; disableSpotlight?: boolean
|
|||||||
<div className="main-content">
|
<div className="main-content">
|
||||||
{thread.root && renderRoot(thread.root)}
|
{thread.root && renderRoot(thread.root)}
|
||||||
{thread.root && renderChain(chainKey(thread.root))}
|
{thread.root && renderChain(chainKey(thread.root))}
|
||||||
|
{!thread.root && renderCurrent()}
|
||||||
|
{!thread.root && !thread.current && (
|
||||||
|
<NoteGhost>
|
||||||
|
<FormattedMessage defaultMessage="Looking up thread..." id="JA+tz3" />
|
||||||
|
</NoteGhost>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -631,6 +631,9 @@
|
|||||||
"J2HeQ+": {
|
"J2HeQ+": {
|
||||||
"defaultMessage": "Use commas to separate words e.g. word1, word2, word3"
|
"defaultMessage": "Use commas to separate words e.g. word1, word2, word3"
|
||||||
},
|
},
|
||||||
|
"JA+tz3": {
|
||||||
|
"defaultMessage": "Looking up thread..."
|
||||||
|
},
|
||||||
"JCIgkj": {
|
"JCIgkj": {
|
||||||
"defaultMessage": "Username"
|
"defaultMessage": "Username"
|
||||||
},
|
},
|
||||||
|
@ -208,6 +208,7 @@
|
|||||||
"J+dIsA": "Subscriptions",
|
"J+dIsA": "Subscriptions",
|
||||||
"J1iLmb": "Notifications Not Allowed",
|
"J1iLmb": "Notifications Not Allowed",
|
||||||
"J2HeQ+": "Use commas to separate words e.g. word1, word2, word3",
|
"J2HeQ+": "Use commas to separate words e.g. word1, word2, word3",
|
||||||
|
"JA+tz3": "Looking up thread...",
|
||||||
"JCIgkj": "Username",
|
"JCIgkj": "Username",
|
||||||
"JGrt9q": "Send sats to {name}",
|
"JGrt9q": "Send sats to {name}",
|
||||||
"JHEHCk": "Zaps ({n})",
|
"JHEHCk": "Zaps ({n})",
|
||||||
|
Loading…
Reference in New Issue
Block a user