🐛 Fix hidden preview buttons in Standard Payments

Addresses an issue when toggling the “Customize per location” checkbox multiple times.
This commit is contained in:
Philipp Stracker 2024-06-14 15:50:17 +02:00
parent e748ef74ba
commit c0c4d8d514
No known key found for this signature in database

View file

@ -206,7 +206,18 @@ class PreviewButtonManager {
* Apples the provided configuration to all existing preview buttons.
*/
_configureAllButtons(ppcpConfig) {
Object.keys(this.buttons).forEach(id => this._configureButton(id, ppcpConfig));
Object.entries(this.buttons).forEach(([id, button]) => {
this._configureButton(id, {
...ppcpConfig,
button: {
...ppcpConfig.button,
// The ppcpConfig object might refer to a different wrapper.
// Fix the selector, to avoid unintentionally hidden preview buttons.
wrapper: button.wrapper,
},
});
});
}
/**