fix(notes): hide discovery button if empty
All checks were successful
Release to Staging / build_and_release (push) Successful in 1m5s

This commit is contained in:
en 2025-02-21 18:56:19 +01:00
parent d70495c4cf
commit e752ed2bb1

View File

@ -14,7 +14,6 @@ import { NoteSubmit } from 'components/Notes/NoteSubmit'
import { Note } from 'components/Notes/Note' import { Note } from 'components/Notes/Note'
import { FeedPostsFilter, RepostFilter } from 'types' import { FeedPostsFilter, RepostFilter } from 'types'
import { DEFAULT_FILTER_OPTIONS } from 'utils' import { DEFAULT_FILTER_OPTIONS } from 'utils'
import { Dots } from 'components/Spinner'
export const FeedTabPosts = () => { export const FeedTabPosts = () => {
const SHOWING_STEP = 20 const SHOWING_STEP = 20
@ -190,27 +189,20 @@ export const FeedTabPosts = () => {
return ( return (
<> <>
<NoteSubmit /> <NoteSubmit />
<div> {discoveredCount ? (
<button <div>
className='btnMain' <button
type='button' className='btnMain'
style={{ width: '100%' }} type='button'
onClick={discoveredCount ? handleDiscoveredClick : undefined} style={{ width: '100%' }}
> onClick={discoveredCount ? handleDiscoveredClick : undefined}
<span> >
{isFetching ? ( <span>
<>
Discovering notes
<Dots />
</>
) : discoveredCount ? (
<>Load {discoveredCount} discovered notes</> <>Load {discoveredCount} discovered notes</>
) : ( </span>
<>No new notes</> </button>
)} </div>
</span> ) : null}
</button>
</div>
{isFetching && <LoadingSpinner desc='Fetching notes from relays' />} {isFetching && <LoadingSpinner desc='Fetching notes from relays' />}
{filteredNotes.length === 0 && !isFetching && ( {filteredNotes.length === 0 && !isFetching && (
<div className='IBMSMListFeedNoPosts'> <div className='IBMSMListFeedNoPosts'>