Skip to content

Commit eae51f3

Browse files
committed
fix: threadlist loadmore
1 parent 6beefba commit eae51f3

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

package/src/components/Indicators/LoadingIndicator.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ import { useTranslationContext } from '../../contexts/translationContext/Transla
66
import { primitives } from '../../theme';
77
import { Spinner } from '../UIComponents/Spinner';
88

9-
type LoadingIndicatorWrapperProps = { text: string };
9+
type LoadingIndicatorWrapperProps = { text: string | undefined };
1010

1111
const LoadingIndicatorWrapper = ({ text }: LoadingIndicatorWrapperProps) => {
1212
const styles = useStyles();
1313

1414
return (
1515
<View style={styles.container}>
1616
<Spinner height={20} width={20} />
17-
<Text style={styles.loadingText} testID='loading'>
18-
{text}
19-
</Text>
17+
{text ? (
18+
<Text style={styles.loadingText} testID='loading'>
19+
{text}
20+
</Text>
21+
) : null}
2022
</View>
2123
);
2224
};
@@ -44,7 +46,7 @@ export const LoadingIndicator = (props: LoadingProps) => {
4446
case 'message':
4547
return <LoadingIndicatorWrapper text={t('Loading messages...')} />;
4648
case 'threads':
47-
return <LoadingIndicatorWrapper text={t('Loading threads...')} />;
49+
return <LoadingIndicatorWrapper text={undefined} />;
4850
default:
4951
return <LoadingIndicatorWrapper text={t('Loading...')} />;
5052
}

package/src/components/ThreadList/ThreadList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const DefaultThreadListLoadingIndicator = () => (
4545
))}
4646
</View>
4747
);
48-
export const DefaultThreadListLoadingNextIndicator = () => <LoadingIndicator />;
48+
export const DefaultThreadListLoadingNextIndicator = () => <LoadingIndicator listType='threads' />;
4949

5050
const renderItem = (props: { item: Thread }) => <ThreadListItem thread={props.item} />;
5151

0 commit comments

Comments
 (0)