Skip to content

Commit

Permalink
Merge pull request stakwork#722 from aliraza556/feature-optimize-tick…
Browse files Browse the repository at this point in the history
…et-editor-store-integration
  • Loading branch information
humansinstitute authored Dec 6, 2024
2 parents 11a3f27 + 8927b19 commit 3c49eb1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/components/common/TicketEditor/TicketEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,12 @@ const TicketEditor = ({ ticketData, websocketSessionId }: TicketEditorProps) =>
const { main } = useStores();

useEffect(() => {
const fetchTicketDetails = async () => {
try {
const ticket = await main.getTicketDetails(ticketData.uuid);
if (ticket) {
setDescription(ticket.description || '');
setName(ticket.name || 'Ticket');
}
} catch (error) {
console.error('Error fetching ticket details:', error);
}
};

fetchTicketDetails();
}, [ticketData.uuid, main]);
const storedTicket = phaseTicketStore.getTicket(ticketData.uuid);
if (storedTicket) {
setDescription(storedTicket.description || '');
setName(storedTicket.name || 'Ticket');
}
}, [ticketData.uuid]);

const addUpdateSuccessToast = () => {
setToasts([
Expand Down
2 changes: 2 additions & 0 deletions src/people/widgetViews/PhasePlannerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ const PhasePlannerView: React.FC = () => {
if (ticket.UUID) {
ticket.uuid = ticket.UUID;
}

phaseTicketStore.addTicket(ticket);
parsedTicketData.push({ ...ticket });
}
setFeatureData(feature);
Expand Down

0 comments on commit 3c49eb1

Please sign in to comment.