mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 07:27:04 +03:00
Moved from master
This commit is contained in:
parent
134deb8d73
commit
19c78c2350
37 changed files with 797 additions and 0 deletions
28
dev/Stores/User/Template.js
Normal file
28
dev/Stores/User/Template.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import ko from 'ko';
|
||||
|
||||
// import Remote from 'Remote/User/Fetch';
|
||||
|
||||
export const TemplateUserStore = new class {
|
||||
constructor() {
|
||||
this.templates = ko.observableArray();
|
||||
this.templates.loading = ko.observable(false).extend({ debounce: 100 });
|
||||
|
||||
this.templatesNames = ko.observableArray().extend({ debounce: 1000 });
|
||||
this.templatesNames.skipFirst = true;
|
||||
|
||||
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);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue