open-vault/ui/app/helpers/set-flash-message.js

14 lines
255 B
JavaScript

import Ember from 'ember';
const { Helper, inject } = Ember;
export default Helper.extend({
flashMessages: inject.service(),
compute([message, type]) {
return () => {
this.get('flashMessages')[type || 'success'](message);
};
},
});