Skip to content

Commit 16074eb

Browse files
fix: error
1 parent 7799c5a commit 16074eb

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/plugins/system/www/plugin.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,19 @@ module.exports = {
164164
return myInAppBrowser;
165165
},
166166
setUiTheme: function (systemBarColor, theme, onSuccess, onFail) {
167-
const color = systemBarColor.toLowerCase();
167+
const color = systemBarColor.toLowerCase();
168168

169169
if (color === '#ffffff' || color === '#ffffffff') {
170170
systemBarColor = '#fffffe';
171171
}
172172

173-
174-
cordova.exec((out)=>{
173+
cordova.exec((out) => {
175174
window.statusbar.setBackgroundColor(systemBarColor);
176-
onSuccess(out);
175+
176+
if (typeof onSuccess === "function") {
177+
onSuccess(out);
178+
}
179+
177180
}, onFail, 'System', 'set-ui-theme', [systemBarColor, theme]);
178181
},
179182
setIntentHandler: function (handler, onerror) {

0 commit comments

Comments
 (0)