@@ -12,7 +12,7 @@ import { OfficeDataAccessHelper } from "./office-data-access-helper.mjs";
1212Office . onReady ( ( ) => { } ) ;
1313
1414async function onTypicalReplyButtonClicked ( event ) {
15- const actionId = event . source . id ;
15+ const actionId = event . source . id ;
1616 console . debug ( "actionId: " + actionId ) ;
1717 console . debug ( "conversationId: " + Office . context . mailbox . item . conversationId ) ;
1818 const originalMailData = {
@@ -24,22 +24,34 @@ async function onTypicalReplyButtonClicked(event) {
2424 id : Office . context . mailbox . item . itemId ,
2525 } ;
2626 try {
27- const buttonConfig = await ConfigLoader . loadConfigForCurrentLanguageAndButtonId ( Office . context . displayLanguage , actionId ) ;
27+ const buttonConfig = await ConfigLoader . loadConfigForCurrentLanguageAndButtonId (
28+ Office . context . displayLanguage ,
29+ actionId
30+ ) ;
2831 if ( ! buttonConfig ) {
29- console . log ( "no button config find." )
32+ console . log ( "no button config find." ) ;
3033 return event . completed ( ) ;
3134 }
32- const replyMailData = MailDataCreator . CreateDataOnForReplyForm ( { config : buttonConfig , originalMailData } ) ;
35+ const replyMailData = MailDataCreator . CreateDataOnForReplyForm ( {
36+ config : buttonConfig ,
37+ originalMailData,
38+ } ) ;
3339 if ( ! replyMailData ) {
34- console . log ( "failed to create reply mail data." )
40+ console . log ( "failed to create reply mail data." ) ;
3541 return event . completed ( ) ;
3642 }
37- Office . context . roamingSettings . set ( "conversationId" , Office . context . mailbox . item . conversationId ?? "" ) ;
43+ Office . context . roamingSettings . set (
44+ "conversationId" ,
45+ Office . context . mailbox . item . conversationId ?? ""
46+ ) ;
3847 Office . context . roamingSettings . set ( "actionId" , actionId ) ;
3948 await OfficeDataAccessHelper . saveRoamingSettingsAsync ( ) ;
40- replyMailData . executeMethod ( { attachments : replyMailData . attachments , callback : ( ) => {
41- event . completed ( ) ;
42- } } ) ;
49+ replyMailData . executeMethod ( {
50+ attachments : replyMailData . attachments ,
51+ callback : ( ) => {
52+ event . completed ( ) ;
53+ } ,
54+ } ) ;
4355 } catch ( e ) {
4456 console . log ( "createNewMail Failed:" , e ) ;
4557 event . completed ( ) ;
@@ -48,21 +60,24 @@ async function onTypicalReplyButtonClicked(event) {
4860window . onTypicalReplyButtonClicked = onTypicalReplyButtonClicked ;
4961
5062async function onNewMessageComposeCreated ( event ) {
51- const conversationId = Office . context . mailbox . item . conversationId ;
63+ const conversationId = Office . context . mailbox . item . conversationId ;
5264 const actionId = Office . context . roamingSettings . get ( "actionId" ) ?. trim ( ) ?? "" ;
5365 const targetConversationId = Office . context . roamingSettings . get ( "conversationId" ) ?. trim ( ) ?? "" ;
5466 console . debug ( "action id: " + actionId ) ;
5567 console . debug ( "targetConversation id: " + targetConversationId ) ;
5668 if ( conversationId !== targetConversationId ) {
5769 return event . completed ( ) ;
5870 }
59- const buttonConfig = await ConfigLoader . loadConfigForCurrentLanguageAndButtonId ( Office . context . displayLanguage , actionId ) ;
71+ const buttonConfig = await ConfigLoader . loadConfigForCurrentLanguageAndButtonId (
72+ Office . context . displayLanguage ,
73+ actionId
74+ ) ;
6075 Office . context . roamingSettings . remove ( "conversationId" ) ;
6176 Office . context . roamingSettings . remove ( "actionId" ) ;
6277 await OfficeDataAccessHelper . saveRoamingSettingsAsync ( ) ;
6378
6479 const currentSubject = await OfficeDataAccessHelper . getSubjectAsync ( ) ;
65- const data = MailDataCreator . CreateReplyMailData ( { config : buttonConfig , currentSubject} ) ;
80+ const data = MailDataCreator . CreateReplyMailData ( { config : buttonConfig , currentSubject } ) ;
6681 if ( data . newToRecipients ) {
6782 await OfficeDataAccessHelper . setToAsync ( data . newToRecipients ) ;
6883 }
0 commit comments