Drop ko.extenders.limitedList

This commit is contained in:
the-djmaze 2022-09-26 11:55:26 +02:00
parent deeb86bd5f
commit d1d820da73
8 changed files with 14 additions and 77 deletions

View file

@ -1,7 +1,7 @@
import ko from 'ko';
import { koComputable } from 'External/ko';
import { FolderType, FolderSortMode } from 'Common/EnumsUser';
import { FolderType } from 'Common/EnumsUser';
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
import { forEachObjectEntry } from 'Common/Utils';
import { addObservablesTo, addSubscribablesTo, addComputablesTo } from 'External/ko';
@ -44,7 +44,7 @@ export const FolderUserStore = new class {
foldersInboxUnreadCount: 0
});
self.sortMode = ko.observable('').extend({ limitedList: Object.values(FolderSortMode) });
self.sortMode = ko.observable('');
self.namespace = '';

View file

@ -1,7 +1,7 @@
import ko from 'ko';
import { koComputable } from 'External/ko';
import { Layout, EditorDefaultType, ComposeType } from 'Common/EnumsUser';
import { Layout } from 'Common/EnumsUser';
import { pInt } from 'Common/Utils';
import { addObservablesTo } from 'External/ko';
import { $htmlCL, SettingsGet, fireEvent } from 'Common/Globals';
@ -11,24 +11,6 @@ export const SettingsUserStore = new class {
constructor() {
const self = this;
self.layout = ko
.observable(1)
.extend({ limitedList: Object.values(Layout) });
self.editorDefaultType = ko.observable('Html').extend({
limitedList: [
EditorDefaultType.Html,
EditorDefaultType.Plain
]
});
self.msgDefaultAction = ko.observable(1).extend({
limitedList: [
ComposeType.Reply,
ComposeType.ReplyAll
]
});
self.messagesPerPage = ko.observable(25).extend({ debounce: 999 });
self.messageReadDelay = ko.observable(5).extend({ debounce: 999 });
@ -48,7 +30,11 @@ export const SettingsUserStore = new class {
requestReadReceipt: 0,
requestDsn: 0,
pgpSign: 0,
pgpEncrypt: 0
pgpEncrypt: 0,
layout: 1,
editorDefaultType: 'Html',
msgDefaultAction: 1
});
self.init();