Merge pull request #8 from v0l/global

fix: force timeline rerender on tab change
This commit is contained in:
Kieran 2023-01-06 15:49:28 +00:00 committed by GitHub
commit e203a21839
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -5,10 +5,8 @@ import Note from "./Note";
/**
* A list of notes by pubkeys
*/
export default function Timeline(props) {
const pubkeys = props.pubkeys;
const global = props.global;
const feed = useTimelineFeed(pubkeys, global ?? false);
export default function Timeline({ global, pubkeys }) {
const feed = useTimelineFeed(pubkeys, global);
function reaction(id, kind = EventKind.Reaction) {
return feed?.others?.filter(a => a.kind === kind && a.tags.some(b => b[0] === "e" && b[1] === id));

View File

@ -35,7 +35,7 @@ export default function RootPage() {
</div>
</div></> : null}
{followHints()}
<Timeline pubkeys={follows} global={loggedOut === true || tab === RootTab.Global} />
<Timeline key={tab} pubkeys={follows} global={loggedOut || tab === RootTab.Global} />
</>
);
}