Skip to content

Commit

Permalink
TASK: Disable concurrent change monitor in selection mode
Browse files Browse the repository at this point in the history
It’s not required to poll for updates when we only select assets
  • Loading branch information
Sebobo committed Jul 16, 2024
1 parent 1e80a39 commit bc69ea1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const ConcurrentChangeMonitor: React.FC = () => {
const { refetch: refetchAssets } = useAssetsQuery();

useEffect(() => {
// Prevent errors when the queries are not yet initialized
if (!refetchAssets || !refetchAsset) {
return;
}
changedAssets?.forEach((change) => {
switch (change.type) {
case 'ASSET_REPLACED':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const App = () => {

<InteractionDialogRenderer />
<ClipboardWatcher />
<ConcurrentChangeMonitor />
{!selectionMode && <ConcurrentChangeMonitor />}
</div>
);
};
Expand Down

0 comments on commit bc69ea1

Please sign in to comment.