mirror of
https://ark.sudovanilla.org/Korbs/electron-tabs.git
synced 2024-12-23 03:53:53 +00:00
Prevent undefined/false value to be set
This commit is contained in:
parent
c84d8194a5
commit
db5738fa7d
8
index.js
8
index.js
|
@ -161,13 +161,13 @@ class Tab extends EventEmitter {
|
||||||
setBadge (badge) {
|
setBadge (badge) {
|
||||||
if (this.isClosed) return;
|
if (this.isClosed) return;
|
||||||
let span = this.tabElements.badge;
|
let span = this.tabElements.badge;
|
||||||
span.innerHTML = badge;
|
|
||||||
this.badge = badge;
|
this.badge = badge;
|
||||||
|
|
||||||
if (!badge) {
|
if (badge) {
|
||||||
span.classList.add('hidden');
|
span.innerHTML = badge;
|
||||||
} else {
|
|
||||||
span.classList.remove('hidden');
|
span.classList.remove('hidden');
|
||||||
|
} else {
|
||||||
|
span.classList.add('hidden');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.emit("badge-changed", badge, this);
|
this.emit("badge-changed", badge, this);
|
||||||
|
|
Loading…
Reference in a new issue