mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
🩹 Fix incorrect usage of #-prefix
Only properties can be declared as private using `#`. For functions, this is not supported yet, using the private-prefix here is unreliable.
This commit is contained in:
parent
f5e67c4810
commit
e748ef74ba
1 changed files with 5 additions and 5 deletions
|
@ -185,7 +185,7 @@ class PreviewButtonManager {
|
|||
}
|
||||
|
||||
if (!this.buttons[id]) {
|
||||
this.#addButton(id, ppcpConfig);
|
||||
this._addButton(id, ppcpConfig);
|
||||
} else {
|
||||
// This is a debounced method, that fires after 100ms.
|
||||
this._configureAllButtons(ppcpConfig);
|
||||
|
@ -195,7 +195,7 @@ class PreviewButtonManager {
|
|||
/**
|
||||
* Applies a new configuration to an existing preview button.
|
||||
*/
|
||||
#configureButton(id, ppcpConfig) {
|
||||
_configureButton(id, ppcpConfig) {
|
||||
this.buttons[id]
|
||||
.setDynamic(this.isDynamic())
|
||||
.setPpcpConfig(ppcpConfig)
|
||||
|
@ -206,19 +206,19 @@ class PreviewButtonManager {
|
|||
* Apples the provided configuration to all existing preview buttons.
|
||||
*/
|
||||
_configureAllButtons(ppcpConfig) {
|
||||
Object.keys(this.buttons).forEach(id => this.#configureButton(id, ppcpConfig));
|
||||
Object.keys(this.buttons).forEach(id => this._configureButton(id, ppcpConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new preview button, that is rendered once the bootstrapping Promise resolves.
|
||||
*/
|
||||
#addButton(id, ppcpConfig) {
|
||||
_addButton(id, ppcpConfig) {
|
||||
const createButton = () => {
|
||||
if (!this.buttons[id]) {
|
||||
this.buttons[id] = this.createButtonInstance(id).setButtonConfig(this.buttonConfig);
|
||||
}
|
||||
|
||||
this.#configureButton(id, ppcpConfig);
|
||||
this._configureButton(id, ppcpConfig);
|
||||
};
|
||||
|
||||
if (this.#onInit) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue