mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-24 19:10:22 +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';
|
||||
|
||||
const AdvancedGasFeeSaveButton = () => {
|
||||
const { closeAllModals } = useTransactionModalContext();
|
||||
const { closeModal } = useTransactionModalContext();
|
||||
const { updateTransactionEventFragment } = useTransactionEventFragment();
|
||||
const { updateTransaction } = useGasFeeContext();
|
||||
const {
|
||||
@ -33,7 +33,7 @@ const AdvancedGasFeeSaveButton = () => {
|
||||
gas_edit_type: 'advanced',
|
||||
},
|
||||
});
|
||||
closeAllModals();
|
||||
closeModal(['advancedGasFee', 'editGasFee']);
|
||||
};
|
||||
|
||||
return (
|
||||
|
@ -84,7 +84,7 @@ const CancelSpeedupPopover = () => {
|
||||
} else {
|
||||
speedUpTransaction();
|
||||
}
|
||||
closeModal('cancelSpeedUpTransaction');
|
||||
closeModal(['cancelSpeedUpTransaction']);
|
||||
};
|
||||
|
||||
return (
|
||||
|
@ -87,7 +87,7 @@ const EditGasItem = ({ priorityLevel }) => {
|
||||
},
|
||||
});
|
||||
|
||||
closeModal('editGasFee');
|
||||
closeModal(['editGasFee']);
|
||||
|
||||
if (priorityLevel === PRIORITY_LEVELS.TEN_PERCENT_INCREASED) {
|
||||
updateTransactionToTenPercentIncreasedGasFee();
|
||||
|
@ -6,13 +6,15 @@ export const TransactionModalContext = createContext({});
|
||||
export const TransactionModalContextProvider = ({ children }) => {
|
||||
const [openModals, setOpenModals] = useState([]);
|
||||
|
||||
const closeModal = (modalName) => {
|
||||
const index = openModals.indexOf(modalName);
|
||||
const closeModal = (modalNames) => {
|
||||
if (openModals < 0) {
|
||||
return;
|
||||
}
|
||||
const modals = [...openModals];
|
||||
modals.splice(index, 1);
|
||||
modalNames.forEach((modal) => {
|
||||
const index = openModals.indexOf(modal);
|
||||
modals.splice(index, 1);
|
||||
});
|
||||
setOpenModals(modals);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user