+{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

				@visibleModal = true
				@toggleOverlayStatus()

				@disposables.push modal.onDidChangeVisible => @checkModals()

	checkModals: ->
		visibleModal = false

			@workspace.setAttribute DATA_STATUS, @visibleModal

	destroy: ->
		@subscriptions.dispose()

module.exports = ModalHandler