+{CompositeDisposable} = require 'atom'
+
 DATA_STATUS = 'outlander-visible-modal';
 
 class ModalHandler
 	visibleModal: false
 
-	disposables: []
+	constructor: ->
+		@subscriptions = new CompositeDisposable
 
-	constructor: ->
 		workspace = document.querySelector('atom-workspace')
 
 		if workspace

			@workspace.setAttribute DATA_STATUS, @visibleModal

	destroy: ->
		disposable.dispose() for disposoable in @disposables

module.exports = ModalHandler
				@visibleModal = true
				@toggleOverlayStatus()

				@subscriptions.add modal.onDidChangeVisible => @checkModals()

	checkModals: ->
		visibleModal = false
