Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev rook st 4671 4677 #4817

Merged
merged 2 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ const useOIPCHook = () => {
}
const [oipcData, setOipcData] = useState(requestDetails.oipcdetails);
const [isOIPCReview, setIsOIPCReview] = useState(requestDetails.isoipcreview);

const [resettoInitial, setResettoInitial] = useState(false);
useEffect(() => {
if (resettoInitial == false) {
const stagedOIPCData = stageOIPCData(isOIPCReview, requestDetails.oipcdetails);
setOipcData(stagedOIPCData);
}
}, [isOIPCReview])

//OIPC Functions
Expand All @@ -59,11 +61,17 @@ const useOIPCHook = () => {
})
}
const removeOIPC = (oipcId) => {
if (oipcData.length == 1) {
setOipcData([]);
setResettoInitial(true)
}
else {
setOipcData((prev) => {
const previousOIPCData = [...prev];
return previousOIPCData.filter(oipc => oipcId !== oipc.id);
return previousOIPCData.filter(oipc => oipcId !== oipc.id);
});
}
}
const updateOIPC = (newOIPCObj) => {
setOipcData((prev) => {
const previousOIPCData = [...prev];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.request-flag {

margin-left: -50px;
padding-top: 50px;

.request-flag-dropdown-all {
Expand Down
Loading