mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-25 03:20:23 +01:00
speedup transaction: save on advance gas modal should not close speed… (#14101)
This commit is contained in:
parent
a74f898dcc
commit
614457d9b6
@ -11,7 +11,7 @@ import I18nValue from '../../../ui/i18n-value';
|
|||||||
import { useAdvancedGasFeePopoverContext } from '../context';
|
import { useAdvancedGasFeePopoverContext } from '../context';
|
||||||
|
|
||||||
const AdvancedGasFeeSaveButton = () => {
|
const AdvancedGasFeeSaveButton = () => {
|
||||||
const { closeAllModals } = useTransactionModalContext();
|
const { closeModal } = useTransactionModalContext();
|
||||||
const { updateTransactionEventFragment } = useTransactionEventFragment();
|
const { updateTransactionEventFragment } = useTransactionEventFragment();
|
||||||
const { updateTransaction } = useGasFeeContext();
|
const { updateTransaction } = useGasFeeContext();
|
||||||
const {
|
const {
|
||||||
@ -33,7 +33,7 @@ const AdvancedGasFeeSaveButton = () => {
|
|||||||
gas_edit_type: 'advanced',
|
gas_edit_type: 'advanced',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
closeAllModals();
|
closeModal(['advancedGasFee', 'editGasFee']);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -84,7 +84,7 @@ const CancelSpeedupPopover = () => {
|
|||||||
} else {
|
} else {
|
||||||
speedUpTransaction();
|
speedUpTransaction();
|
||||||
}
|
}
|
||||||
closeModal('cancelSpeedUpTransaction');
|
closeModal(['cancelSpeedUpTransaction']);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -87,7 +87,7 @@ const EditGasItem = ({ priorityLevel }) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
closeModal('editGasFee');
|
closeModal(['editGasFee']);
|
||||||
|
|
||||||
if (priorityLevel === PRIORITY_LEVELS.TEN_PERCENT_INCREASED) {
|
if (priorityLevel === PRIORITY_LEVELS.TEN_PERCENT_INCREASED) {
|
||||||
updateTransactionToTenPercentIncreasedGasFee();
|
updateTransactionToTenPercentIncreasedGasFee();
|
||||||
|
@ -6,13 +6,15 @@ export const TransactionModalContext = createContext({});
|
|||||||
export const TransactionModalContextProvider = ({ children }) => {
|
export const TransactionModalContextProvider = ({ children }) => {
|
||||||
const [openModals, setOpenModals] = useState([]);
|
const [openModals, setOpenModals] = useState([]);
|
||||||
|
|
||||||
const closeModal = (modalName) => {
|
const closeModal = (modalNames) => {
|
||||||
const index = openModals.indexOf(modalName);
|
|
||||||
if (openModals < 0) {
|
if (openModals < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const modals = [...openModals];
|
const modals = [...openModals];
|
||||||
|
modalNames.forEach((modal) => {
|
||||||
|
const index = openModals.indexOf(modal);
|
||||||
modals.splice(index, 1);
|
modals.splice(index, 1);
|
||||||
|
});
|
||||||
setOpenModals(modals);
|
setOpenModals(modals);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user