Prettified Code!
This commit is contained in:
18
index.js
18
index.js
@@ -36,8 +36,7 @@ instance.prototype.init = function () {
|
||||
self.getWorkspace()
|
||||
self.getCurrentTimer().then((result) => {
|
||||
self.log('debug', 'Current timer id ' + result)
|
||||
}
|
||||
)
|
||||
})
|
||||
self.actions()
|
||||
}
|
||||
|
||||
@@ -197,13 +196,13 @@ instance.prototype.action = function (action) {
|
||||
}
|
||||
self.sendCommand('rest', cmd, body).then((result) => {
|
||||
if (typeof result == 'object' && result.data !== null && result.data !== undefined) {
|
||||
self.log('debug','New timer started ' + result.data.id)
|
||||
self.log('debug', 'New timer started ' + result.data.id)
|
||||
} else {
|
||||
self.log('warn','Error starting timer')
|
||||
self.log('warn', 'Error starting timer')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
self.log('debug','A timer is already running')
|
||||
self.log('debug', 'A timer is already running')
|
||||
}
|
||||
})
|
||||
break
|
||||
@@ -223,15 +222,13 @@ instance.prototype.action = function (action) {
|
||||
} else {
|
||||
self.log('warn', 'No running timer to stop or running timer id unknown')
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
break
|
||||
}
|
||||
case 'getCurrentTimer': {
|
||||
self.getCurrentTimer().then((result) => {
|
||||
self.log('debug', 'Current timer id ' + result)
|
||||
}
|
||||
)
|
||||
})
|
||||
break
|
||||
}
|
||||
case 'refreshProjects': {
|
||||
@@ -354,8 +351,7 @@ instance.prototype.getCurrentTimer = function () {
|
||||
self.log('debug', 'Error getting current timer')
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
instance.prototype.sendCommand = function (mode, command, body = '') {
|
||||
|
||||
Reference in New Issue
Block a user