2017-08-22 10:53:26 +03:00
|
|
|
import Component from '@ember/component';
|
|
|
|
import {alias} from '@ember/object/computed';
|
|
|
|
import {inject as injectService} from '@ember/service';
|
|
|
|
import {observer} from '@ember/object';
|
2015-10-28 14:36:45 +03:00
|
|
|
|
|
|
|
export default Component.extend({
|
2015-05-21 20:03:24 +03:00
|
|
|
tagName: 'aside',
|
|
|
|
classNames: 'gh-alerts',
|
|
|
|
|
2016-06-30 21:14:25 +03:00
|
|
|
notifications: injectService(),
|
2015-05-21 20:03:24 +03:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
messages: alias('notifications.alerts'),
|
2015-05-21 20:03:24 +03:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
messageCountObserver: observer('messages.[]', function () {
|
2015-05-21 20:03:24 +03:00
|
|
|
this.sendAction('notify', this.get('messages').length);
|
|
|
|
})
|
|
|
|
});
|