Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
changeStatusBar() {
Plugins.StatusBar.setStyle({
style: this.isStatusBarLight ? StatusBarStyle.Dark : StatusBarStyle.Light
});
this.isStatusBarLight = !this.isStatusBarLight;
}
mounted() {
for (const selector of metaSelectors) {
document.querySelector(selector).content = this.newStatusbarColor
}
StatusBar.setBackgroundColor({ color: this.newStatusbarColor }).catch(this.$helpers.err)
StatusBar.setStyle({ style: StatusBarStyle.Dark }).catch(this.$helpers.err)
},
beforeRouteLeave(to, from, next) {
this.platform.ready().then(() => {
if (this.platform.is('capacitor')) {
StatusBar.setStyle({
style: StatusBarStyle.Dark
});
}
});
}