mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-08 22:18:28 +03:00
this.addObservables() to addObservablesTo()
This commit is contained in:
parent
839ebfb350
commit
7fac6ca9dd
30 changed files with 78 additions and 58 deletions
|
|
@ -2,6 +2,7 @@ import { Notification } from 'Common/Enums';
|
|||
import { ClientSideKeyNameLastSignMe } from 'Common/EnumsUser';
|
||||
import { SettingsGet, fireEvent } from 'Common/Globals';
|
||||
import { getNotification, translatorReload, convertLangName } from 'Common/Translator';
|
||||
import { addObservablesTo, addComputablesTo, addSubscribablesTo } from 'External/ko';
|
||||
|
||||
import { LanguageStore } from 'Stores/Language';
|
||||
|
||||
|
|
@ -24,7 +25,7 @@ export class LoginUserView extends AbstractViewLogin {
|
|||
constructor() {
|
||||
super();
|
||||
|
||||
this.addObservables({
|
||||
addObservablesTo(this, {
|
||||
loadingDesc: SettingsGet('LoadingDescription'),
|
||||
|
||||
email: SettingsGet('DevEmail'),
|
||||
|
|
@ -50,14 +51,14 @@ export class LoginUserView extends AbstractViewLogin {
|
|||
|
||||
this.bSendLanguage = false;
|
||||
|
||||
this.addComputables({
|
||||
addComputablesTo(this, {
|
||||
|
||||
languageFullName: () => convertLangName(this.language()),
|
||||
|
||||
signMeVisibility: () => SignMeUnused !== this.signMeType()
|
||||
});
|
||||
|
||||
this.addSubscribables({
|
||||
addSubscribablesTo(this, {
|
||||
email: () => this.emailError(false),
|
||||
|
||||
password: () => this.passwordError(false),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import ko from 'ko';
|
||||
import { addObservablesTo, addComputablesTo } from 'External/ko';
|
||||
|
||||
import { Scope } from 'Common/Enums';
|
||||
|
||||
|
|
@ -89,7 +90,7 @@ export class MailMessageList extends AbstractViewRight {
|
|||
|
||||
this.userUsageProc = FolderUserStore.quotaPercentage;
|
||||
|
||||
this.addObservables({
|
||||
addObservablesTo(this, {
|
||||
moreDropdownTrigger: false,
|
||||
sortDropdownTrigger: false,
|
||||
|
||||
|
|
@ -100,7 +101,7 @@ export class MailMessageList extends AbstractViewRight {
|
|||
this.dragOver = ko.observable(false).extend({ throttle: 1 });
|
||||
this.dragOverEnter = ko.observable(false).extend({ throttle: 1 });
|
||||
|
||||
this.addComputables({
|
||||
addComputablesTo(this, {
|
||||
|
||||
sortSupported: () =>
|
||||
FolderUserStore.hasCapability('SORT') | FolderUserStore.hasCapability('ESORT'),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import ko from 'ko';
|
||||
import { addObservablesTo, addComputablesTo, addSubscribablesTo } from 'External/ko';
|
||||
|
||||
import { Scope } from 'Common/Enums';
|
||||
|
||||
|
|
@ -92,7 +93,7 @@ export class MailMessageView extends AbstractViewRight {
|
|||
|
||||
this.msgDefaultAction = SettingsUserStore.msgDefaultAction;
|
||||
|
||||
this.addObservables({
|
||||
addObservablesTo(this, {
|
||||
showAttachmentControls: !!Local.get(ClientSideKeyNameMessageAttachmentControls),
|
||||
downloadAsZipLoading: false,
|
||||
showFullInfo: '1' === Local.get(ClientSideKeyNameMessageHeaderFullInfo),
|
||||
|
|
@ -132,7 +133,7 @@ export class MailMessageView extends AbstractViewRight {
|
|||
// viewer
|
||||
this.viewHash = '';
|
||||
|
||||
this.addComputables({
|
||||
addComputablesTo(this, {
|
||||
allowAttachmentControls: () => arrayLength(attachmentsActions) && SettingsCapa('AttachmentsActions'),
|
||||
|
||||
downloadAsZipAllowed: () => this.attachmentsActions.includes('zip')
|
||||
|
|
@ -174,7 +175,7 @@ export class MailMessageView extends AbstractViewRight {
|
|||
() => MessagelistUserStore.isLoading() | MessageUserStore.loading()
|
||||
});
|
||||
|
||||
this.addSubscribables({
|
||||
addSubscribablesTo(this, {
|
||||
message: message => {
|
||||
if (message) {
|
||||
if (this.viewHash !== message.hash) {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import Remote from 'Remote/User/Fetch';
|
|||
import { getNotification } from 'Common/Translator';
|
||||
//import { clearCache } from 'Common/Cache';
|
||||
//import { koComputable } from 'External/ko';
|
||||
import { addObservablesTo } from 'External/ko';
|
||||
|
||||
export class SystemDropDownUserView extends AbstractViewRight {
|
||||
constructor() {
|
||||
|
|
@ -36,7 +37,7 @@ export class SystemDropDownUserView extends AbstractViewRight {
|
|||
this.accountsUnreadCount = : koComputable(() => AccountUserStore.accounts().reduce((result, item) => result + item.count(), 0));
|
||||
*/
|
||||
|
||||
this.addObservables({
|
||||
addObservablesTo(this, {
|
||||
currentAudio: '',
|
||||
accountMenuDropdownTrigger: false
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue