Commit 07a7d88e authored by Eric Eastwood's avatar Eric Eastwood

Actually unbind and better undefined checking

Thanks @jschatz1 for the review
parent 3d369a94
...@@ -8,11 +8,11 @@ import eventHub from './event_hub'; ...@@ -8,11 +8,11 @@ import eventHub from './event_hub';
class ServiceDeskRoot { class ServiceDeskRoot {
constructor(wrapperElement) { constructor(wrapperElement) {
this.wrapperElement = wrapperElement; this.wrapperElement = wrapperElement;
const isEnabled = this.wrapperElement.dataset.enabled !== undefined && const isEnabled = typeof this.wrapperElement.dataset.enabled !== 'undefined' &&
this.wrapperElement.dataset.enabled !== 'false'; this.wrapperElement.dataset.enabled !== 'false';
const incomingEmail = this.wrapperElement.dataset.incomingEmail; const incomingEmail = this.wrapperElement.dataset.incomingEmail;
const endpoint = this.wrapperElement.dataset.endpoint; const endpoint = this.wrapperElement.dataset.endpoint;
const isInstanceAdmin = this.wrapperElement.dataset.isInstanceAdmin !== undefined && const isInstanceAdmin = typeof this.wrapperElement.dataset.isInstanceAdmin !== 'undefined' &&
this.wrapperElement.dataset.isInstanceAdmin !== 'false'; this.wrapperElement.dataset.isInstanceAdmin !== 'false';
this.store = new ServiceDeskStore({ this.store = new ServiceDeskStore({
...@@ -40,7 +40,7 @@ class ServiceDeskRoot { ...@@ -40,7 +40,7 @@ class ServiceDeskRoot {
} }
unbindEvents() { unbindEvents() {
eventHub.$on('serviceDeskEnabledCheckboxToggled', this.onEnableToggledWrapper); eventHub.$off('serviceDeskEnabledCheckboxToggled', this.onEnableToggledWrapper);
} }
render() { render() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment