Princi Vershwal 2023-12-13 12:46:26 +05:30 committed by GitHub
parent b7648e7bc2
commit 830967d2ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View File

@ -57,6 +57,7 @@ const Offers: React.FC<{ keywords: string[] }> = ({keywords}) => {
}; };
const goToOfferEdit = (offerId: string) => { const goToOfferEdit = (offerId: string) => {
sessionStorage.setItem('editOfferPageSource', 'offers');
updateRoute(`offers/edit/${offerId}`); updateRoute(`offers/edit/${offerId}`);
}; };

View File

@ -269,7 +269,13 @@ const EditOfferModal: React.FC<{id: string}> = ({id}) => {
title='Offer' title='Offer'
width={1140} width={1140}
onCancel={() => { onCancel={() => {
updateRoute('offers/edit'); if (sessionStorage.getItem('editOfferPageSource') === 'offers') {
sessionStorage.removeItem('editOfferPageSource');
updateRoute('offers');
} else {
sessionStorage.removeItem('editOfferPageSource');
updateRoute('offers/edit');
}
}} }}
onOk={async () => { onOk={async () => {
if (!(await handleSave({fakeWhenUnchanged: true}))) { if (!(await handleSave({fakeWhenUnchanged: true}))) {

View File

@ -126,6 +126,7 @@ export const OffersIndexModal = () => {
const handleOfferEdit = (id:string) => { const handleOfferEdit = (id:string) => {
// TODO: implement // TODO: implement
sessionStorage.setItem('editOfferPageSource', 'offersIndex');
updateRoute(`offers/edit/${id}`); updateRoute(`offers/edit/${id}`);
}; };