mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-05 22:42:25 +08:00
c3a2da65df
Replaced fakeMd5 with new Jua.randomId Cleanup more code
34 lines
824 B
JavaScript
34 lines
824 B
JavaScript
import ko from 'ko';
|
|
|
|
// import Remote from 'Remote/User/Fetch';
|
|
|
|
class TemplateUserStore {
|
|
constructor() {
|
|
this.templates = ko.observableArray([]);
|
|
this.templates.loading = ko.observable(false).extend({ throttle: 100 });
|
|
|
|
this.templatesNames = ko.observableArray([]).extend({ throttle: 1000 });
|
|
this.templatesNames.skipFirst = true;
|
|
|
|
this.subscribers();
|
|
}
|
|
|
|
subscribers() {
|
|
this.templates.subscribe((list) => {
|
|
this.templatesNames(list.map(item => (item ? item.name : null)).filter(v => v));
|
|
});
|
|
|
|
// this.templatesNames.subscribe((aList) => {
|
|
// if (this.templatesNames.skipFirst)
|
|
// {
|
|
// this.templatesNames.skipFirst = false;
|
|
// }
|
|
// else if (aList && aList.length)
|
|
// {
|
|
// Remote.templatesSortOrder(null, aList);
|
|
// }
|
|
// });
|
|
}
|
|
}
|
|
|
|
export default new TemplateUserStore();
|