Skip to content

Commit 2a455c5

Browse files
committed
Small syntax tweak
1 parent b859a3b commit 2a455c5

1 file changed

Lines changed: 7 additions & 20 deletions

File tree

assets/js/web-components/prpl-install-plugin.js

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,11 @@ customElements.define(
4040
// Set the inner HTML.
4141
this.innerHTML = `
4242
<button type="button" class="${ this.className }">
43-
${
43+
${ prplL10n(
4444
'install' === this.action
45-
? prplL10n( 'installPlugin' ).replace(
46-
'%s',
47-
this.pluginName
48-
)
49-
: prplL10n( 'activatePlugin' ).replace(
50-
'%s',
51-
this.pluginName
52-
)
53-
}
45+
? 'installPlugin'
46+
: 'activatePlugin'
47+
).replace( '%s', this.pluginName ) }
5448
</button>
5549
`;
5650

@@ -79,7 +73,6 @@ customElements.define(
7973

8074
installPlugin() {
8175
const button = this.querySelector( 'button' );
82-
8376
const thisObj = this;
8477

8578
button.innerHTML = `
@@ -96,12 +89,8 @@ customElements.define(
9689
nonce: progressPlanner.nonce,
9790
},
9891
} )
99-
.then( () => {
100-
thisObj.activatePlugin();
101-
} )
102-
.catch( ( error ) => {
103-
console.error( error );
104-
} );
92+
.then( () => thisObj.activatePlugin() )
93+
.catch( ( error ) => console.error( error ) );
10594
}
10695

10796
activatePlugin() {
@@ -125,9 +114,7 @@ customElements.define(
125114
button.innerHTML = prplL10n( 'activated' );
126115
thisObj.completeTask();
127116
} )
128-
.catch( ( error ) => {
129-
console.error( error );
130-
} );
117+
.catch( ( error ) => console.error( error ) );
131118
}
132119

133120
/**

0 commit comments

Comments
 (0)