mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
Bugfix: subscribables should be created after computables
This commit is contained in:
parent
f25d210f3e
commit
8d7e25fc7c
3 changed files with 102 additions and 102 deletions
|
|
@ -159,6 +159,54 @@ class MessageViewMailBoxUserView extends AbstractViewNext {
|
|||
viewIsFlagged: false
|
||||
});
|
||||
|
||||
this.addComputables({
|
||||
allowAttachmnetControls: () => this.attachmentsActions().length && Settings.capa(Capa.AttachmentsActions),
|
||||
|
||||
downloadAsZipAllowed: () => this.attachmentsActions().includes('zip') && this.allowAttachmnetControls(),
|
||||
|
||||
lastReplyAction: {
|
||||
read: this.lastReplyAction_,
|
||||
write: value => this.lastReplyAction_(
|
||||
[ComposeType.Reply, ComposeType.ReplyAll, ComposeType.Forward].includes(value)
|
||||
? ComposeType.Reply
|
||||
: value
|
||||
)
|
||||
},
|
||||
|
||||
messageVisibility: () => !this.messageLoadingThrottle() && !!this.message(),
|
||||
|
||||
canBeRepliedOrForwarded: () => !this.isDraftFolder() && this.messageVisibility(),
|
||||
|
||||
viewFromDkimVisibility: () => 'none' !== this.viewFromDkimData()[0],
|
||||
|
||||
viewFromDkimStatusIconClass:() => {
|
||||
switch (this.viewFromDkimData()[0]) {
|
||||
case 'none':
|
||||
return 'icon-none iconcolor-display-none';
|
||||
case 'pass':
|
||||
return 'icon-ok iconcolor-green';
|
||||
default:
|
||||
return 'icon-warning-alt iconcolor-red';
|
||||
}
|
||||
},
|
||||
|
||||
viewFromDkimStatusTitle:() => {
|
||||
const status = this.viewFromDkimData();
|
||||
if (Array.isNotEmpty(status)) {
|
||||
if (status[0]) {
|
||||
return status[1] || 'DKIM: ' + status[0];
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
messageFocused: () => Focused.MessageView === AppStore.focusedState(),
|
||||
|
||||
messageListAndMessageViewLoading:
|
||||
() => MessageStore.messageListCompleteLoadingThrottle() || MessageStore.messageLoadingThrottle()
|
||||
});
|
||||
|
||||
this.addSubscribables({
|
||||
showAttachmnetControls: v => this.message()
|
||||
&& this.message().attachments().forEach(item => item && item.checked(!!v)),
|
||||
|
|
@ -221,54 +269,6 @@ class MessageViewMailBoxUserView extends AbstractViewNext {
|
|||
message ? this.viewIsFlagged(message.isFlagged()) : this.viewIsFlagged(false);
|
||||
});
|
||||
|
||||
this.addComputables({
|
||||
allowAttachmnetControls: () => this.attachmentsActions().length && Settings.capa(Capa.AttachmentsActions),
|
||||
|
||||
downloadAsZipAllowed: () => this.attachmentsActions().includes('zip') && this.allowAttachmnetControls(),
|
||||
|
||||
lastReplyAction: {
|
||||
read: this.lastReplyAction_,
|
||||
write: value => this.lastReplyAction_(
|
||||
[ComposeType.Reply, ComposeType.ReplyAll, ComposeType.Forward].includes(value)
|
||||
? ComposeType.Reply
|
||||
: value
|
||||
)
|
||||
},
|
||||
|
||||
messageVisibility: () => !this.messageLoadingThrottle() && !!this.message(),
|
||||
|
||||
canBeRepliedOrForwarded: () => !this.isDraftFolder() && this.messageVisibility(),
|
||||
|
||||
viewFromDkimVisibility: () => 'none' !== this.viewFromDkimData()[0],
|
||||
|
||||
viewFromDkimStatusIconClass:() => {
|
||||
switch (this.viewFromDkimData()[0]) {
|
||||
case 'none':
|
||||
return 'icon-none iconcolor-display-none';
|
||||
case 'pass':
|
||||
return 'icon-ok iconcolor-green';
|
||||
default:
|
||||
return 'icon-warning-alt iconcolor-red';
|
||||
}
|
||||
},
|
||||
|
||||
viewFromDkimStatusTitle:() => {
|
||||
const status = this.viewFromDkimData();
|
||||
if (Array.isNotEmpty(status)) {
|
||||
if (status[0]) {
|
||||
return status[1] || 'DKIM: ' + status[0];
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
messageFocused: () => Focused.MessageView === AppStore.focusedState(),
|
||||
|
||||
messageListAndMessageViewLoading:
|
||||
() => MessageStore.messageListCompleteLoadingThrottle() || MessageStore.messageLoadingThrottle()
|
||||
});
|
||||
|
||||
this.lastReplyAction(Local.get(ClientSideKeyName.LastReplyAction) || ComposeType.Reply);
|
||||
|
||||
addEventListener('mailbox.message-view.toggle-full-screen', () => this.toggleFullScreen());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue