Skip to content

Commit

Permalink
fix: update file list immediately after deletion to reflect changes i…
Browse files Browse the repository at this point in the history
…n UI (#695)

Co-authored-by: Zishan Ahmad <[email protected]>
  • Loading branch information
SinghaAnirban005 and Spiral-Memory authored Dec 22, 2024
1 parent f0d2848 commit 88e2851
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/react/src/views/MessageAggregators/FileGallery.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useMemo, useEffect } from 'react';
import { useComponentOverrides } from '@embeddedchat/ui-elements';
import { useChannelStore } from '../../store';
import { useChannelStore, useMessageStore } from '../../store';
import { useRCContext } from '../../context/RCInstance';
import { MessageAggregator } from './common/MessageAggregator';

Expand All @@ -10,6 +10,7 @@ const FileGallery = () => {
const viewType = variantOverrides.viewType || 'Sidebar';

const isChannelPrivate = useChannelStore((state) => state.isChannelPrivate);
const messages = useMessageStore((state) => state.messages);

const [text, setText] = useState('');
const [isFetching, setIsFetching] = useState(true);
Expand Down Expand Up @@ -39,7 +40,7 @@ const FileGallery = () => {
}
};
fetchAllFiles();
}, [RCInstance, isChannelPrivate]);
}, [RCInstance, isChannelPrivate, messages]);

return (
<MessageAggregator
Expand Down

0 comments on commit 88e2851

Please sign in to comment.