mirror of
https://github.com/discourse/discourse.git
synced 2026-08-08 12:08:12 -05:00
REFACTOR: Remove _.chain
This commit is contained in:
@@ -12,14 +12,11 @@ export default Route.extend({
|
||||
if (preloadedLogs && preloadedLogs.length) {
|
||||
// we need to filter out message like: "[SUCCESS]"
|
||||
// and convert POJOs to Ember Objects
|
||||
const newLogs = _.chain(preloadedLogs)
|
||||
.reject(function(log) {
|
||||
return log.message.length === 0 || log.message[0] === "[";
|
||||
const newLogs = preloadedLogs
|
||||
.filter(log => {
|
||||
return log.message.length > 0 && log.message[0] !== "[";
|
||||
})
|
||||
.map(function(log) {
|
||||
return EmberObject.create(log);
|
||||
})
|
||||
.value();
|
||||
.map(log => EmberObject.create(log));
|
||||
logs.pushObjects(newLogs);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user