Skip to content

Commit

Permalink
update the front end websocket processing on phase planner
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtabBukhari committed Dec 17, 2024
1 parent d6ffbdb commit 6b295f0
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/people/widgetViews/PhasePlannerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ const PhasePlannerView: React.FC = observer(() => {
const history = useHistory();
const tickets = phaseTicketStore.getPhaseTickets(phase_uuid);

const getPhaseTickets = useCallback(async () => {
if (!feature_uuid || !phase_uuid) return;
const data = await main.getTicketDataByPhase(feature_uuid, phase_uuid);
return data;
}, [feature_uuid, phase_uuid, main]);

useEffect(() => {
const socket = createSocketInstance();

Expand All @@ -53,6 +59,12 @@ const PhasePlannerView: React.FC = observer(() => {
try {
const ticket = await main.getTicketDetails(ticketUuid);

if (ticket.UUID) {
ticket.uuid = ticket.UUID;
}

phaseTicketStore.addTicket(ticket);

const groupId = ticket.ticket_group || ticket.uuid;

const latestTicket = phaseTicketStore.getLatestVersionFromGroup(groupId);
Expand Down Expand Up @@ -145,12 +157,6 @@ const PhasePlannerView: React.FC = observer(() => {
return data;
}, [feature_uuid, phase_uuid, main]);

const getPhaseTickets = useCallback(async () => {
if (!feature_uuid || !phase_uuid) return;
const data = await main.getTicketDataByPhase(feature_uuid, phase_uuid);
return data;
}, [feature_uuid, phase_uuid, main]);

useEffect(() => {
const fetchData = async () => {
try {
Expand Down

0 comments on commit 6b295f0

Please sign in to comment.