From c1d9ce6ef4f124a81d9d749903ef677167120764 Mon Sep 17 00:00:00 2001 From: Sam Chau Date: Thu, 19 Sep 2024 10:27:06 +0930 Subject: [PATCH] feat: Implement exclusive selection for incoming/outgoing changes --- frontend/src/components/settings/git/ChangeTable.jsx | 2 +- frontend/src/components/settings/git/StatusContainer.jsx | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/settings/git/ChangeTable.jsx b/frontend/src/components/settings/git/ChangeTable.jsx index 76fa996..5af2e21 100644 --- a/frontend/src/components/settings/git/ChangeTable.jsx +++ b/frontend/src/components/settings/git/ChangeTable.jsx @@ -71,7 +71,7 @@ const ChangeTable = ({ Name - + Actions diff --git a/frontend/src/components/settings/git/StatusContainer.jsx b/frontend/src/components/settings/git/StatusContainer.jsx index 4739c13..515c038 100644 --- a/frontend/src/components/settings/git/StatusContainer.jsx +++ b/frontend/src/components/settings/git/StatusContainer.jsx @@ -34,6 +34,9 @@ const StatusContainer = ({ const handleSelectChange = (filePath, isIncoming) => { if (isIncoming) { + if (selectedOutgoingChanges.length > 0) { + setSelectedOutgoingChanges([]); + } setSelectedIncomingChanges(prevSelected => { if (prevSelected.includes(filePath)) { return prevSelected.filter(path => path !== filePath); @@ -42,6 +45,9 @@ const StatusContainer = ({ } }); } else { + if (selectedIncomingChanges.length > 0) { + setSelectedIncomingChanges([]); + } const change = status.outgoing_changes.find( c => c.file_path === filePath );