Merge pull request #170 from cheeaun/main

Update from main
This commit is contained in:
Chee Aun 2023-06-20 21:38:11 +08:00 committed by GitHub
commit 534c4c97cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 10 deletions

View file

@ -189,7 +189,7 @@ function NavMenu(props) {
</MenuLink>
</section>
<section>
{authenticated && (
{authenticated ? (
<>
<MenuDivider />
{currentAccount?.info?.id && (
@ -220,6 +220,13 @@ function NavMenu(props) {
<Icon icon="gear" size="l" /> <span>Settings&hellip;</span>
</MenuItem>
</>
) : (
<>
<MenuDivider />
<MenuLink to="/login">
<Icon icon="user" size="l" /> <span>Log in</span>
</MenuLink>
</>
)}
</section>
</ControlledMenu>

View file

@ -42,15 +42,25 @@ function Hashtags(props) {
useTitle(title, `/:instance?/t/:hashtag`);
const latestItem = useRef();
const hashtagsIterator = useRef();
// const hashtagsIterator = useRef();
const maxID = useRef(undefined);
async function fetchHashtags(firstLoad) {
if (firstLoad || !hashtagsIterator.current) {
hashtagsIterator.current = masto.v1.timelines.listHashtag(hashtag, {
// if (firstLoad || !hashtagsIterator.current) {
// hashtagsIterator.current = masto.v1.timelines.listHashtag(hashtag, {
// limit: LIMIT,
// any: hashtags.slice(1),
// });
// }
// const results = await hashtagsIterator.current.next();
// NOTE: Temporary fix for listHashtag not persisting `any` in subsequent calls.
const results = await masto.v1.timelines
.listHashtag(hashtag, {
limit: LIMIT,
any: hashtags.slice(1),
});
}
const results = await hashtagsIterator.current.next();
maxId: firstLoad ? undefined : maxID.current,
})
.next();
const { value } = results;
if (value?.length) {
if (firstLoad) {
@ -60,6 +70,8 @@ function Hashtags(props) {
value.forEach((item) => {
saveStatus(item, instance);
});
maxID.current = value[value.length - 1].id;
}
return {
...results,

View file

@ -11,9 +11,6 @@
padding: 16px;
cursor: default;
}
#welcome ~ * {
display: none;
}
#welcome .hero-container {
padding-block: 60px;