Skip to content

Commit 6047671

Browse files
Reload when error message is clicked on messagelist
1 parent 87e843e commit 6047671

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/components/Channel/Channel.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,15 @@ export const Channel = <
827827
};
828828

829829
if (!channel || error) {
830-
return <LoadingErrorIndicator error={error} listType='message' />;
830+
return (
831+
<LoadingErrorIndicator
832+
error={error}
833+
listType='message'
834+
retry={() => {
835+
loadMoreThrottled();
836+
}}
837+
/>
838+
);
831839
}
832840

833841
if (!channel?.cid || !channel.watch) {

src/components/Indicators/LoadingErrorIndicator.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export type LoadingErrorProps = {
4343
error?: boolean;
4444
listType?: 'channel' | 'message' | 'default';
4545
loadNextPage?: () => Promise<void>;
46-
retry?: () => Promise<void>;
46+
retry?: () => Promise<void> | void;
4747
};
4848

4949
export const LoadingErrorIndicator: React.FC<LoadingErrorProps> = (props) => {
@@ -64,6 +64,7 @@ export const LoadingErrorIndicator: React.FC<LoadingErrorProps> = (props) => {
6464
case 'message':
6565
return (
6666
<LoadingErrorWrapper
67+
onPress={retry}
6768
text={t('Error loading messages for this channel ...')}
6869
/>
6970
);

0 commit comments

Comments
 (0)