change(ui): keep report state on modal close except the cancel button

This commit is contained in:
sylenien 2022-11-07 11:06:47 +01:00
parent 0f9e31f998
commit 3d719e6ecd

View file

@ -82,9 +82,13 @@ function BugReportModal({ hideModal, session, width, height, account, xrayProps,
fetchMembers()
bugReportStore.updateReportDefaults(defaults);
bugReportStore.setDefaultSteps(mapEvents(events));
return () => bugReportStore.clearStore();
}, []);
const onClose = () => {
hideModal();
return bugReportStore.clearStore();
}
const onGen = () => {
// @ts-ignore
import('html2canvas').then(({ default: html2canvas }) => {
@ -192,7 +196,7 @@ function BugReportModal({ hideModal, session, width, height, account, xrayProps,
<Button icon="file-pdf" variant="primary" onClick={onGen} loading={isRendering}>
Download Bug Report
</Button>
<Button variant="text-primary" onClick={hideModal}>
<Button variant="text-primary" onClick={onClose}>
Close
</Button>
</div>