Refractoring Stage 6.7 Migrated DAV calendar/contact state and rendering calls to the productivity feature API, and made the app shell navigate through that API rather than directly calling legacy renderer globals.
This commit is contained in:
@@ -74,6 +74,24 @@ productivityMailUi.wrapRenderList(baseMessageRenderer => function () {
|
||||
document.addEventListener('click',event=>{const button=event.target.closest('.download');if(!button)return;event.stopImmediatePropagation();const message=productivityMailUi.state.messages.find(item=>item.id===productivityMailUi.state.activeMessage);const filename=button.dataset.filename||message?.attachment;if(!filename){toastProductivityUi('This message has no downloadable attachment');return}if(!message?.uid||!window.daybreakMail?.saveAttachment){toastProductivityUi('Attachment download is available for connected mailbox messages');return}window.daybreakMail.saveAttachment({uid:message.uid,folder:productivityMailUi.state.activeFolder,filename}).then(result=>{if(result.saved)toastProductivityUi('Attachment saved')}).catch(error=>toastProductivityUi(error.message||'Could not save attachment'))},true);
|
||||
|
||||
window.epMailFeatures.productivity = Object.freeze({
|
||||
get events() { return savedEvents; },
|
||||
set events(value) { savedEvents = value; },
|
||||
get contacts() { return savedContacts; },
|
||||
set contacts(value) { savedContacts = value; },
|
||||
get profileName() { return profileSettings.name; },
|
||||
productKeys,
|
||||
productWrite,
|
||||
renderCalendar,
|
||||
renderContacts,
|
||||
showEvent,
|
||||
showContact,
|
||||
setProfileName,
|
||||
openAccountSettings,
|
||||
get openPreferences() { return openPreferences; },
|
||||
select: selectProductivityUi,
|
||||
selectAll: selectAllProductivityUi,
|
||||
toast: toastProductivityUi,
|
||||
escapeHtml: escapeProductivityUi,
|
||||
wrapOpenPreferences(decorator) {
|
||||
openPreferences = decorator(openPreferences);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user