Skip to content

Commit

Permalink
fix: missing prefs pass to onConfirm action
Browse files Browse the repository at this point in the history
  • Loading branch information
geeky-abhishek committed Sep 1, 2022
1 parent 63a074a commit 955adb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/store/editor-slice-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export const extractBody = (msg: MailMessage): Array<string> => {
const htmlArr = findBodyPart(msg.parts, 'text/html');
const text = textArr.length ? textArr[0].replaceAll('\n', '<br/>') : undefined;
const html = htmlArr.length ? htmlArr[0] : undefined;
console.log('mnop:', { text, html });

return [text ?? html ?? '', html ?? text ?? ''];
};

Expand Down
5 changes: 3 additions & 2 deletions src/views/app/detail-panel/edit/parts/send-later-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
import React, { FC, useCallback, useMemo, useState } from 'react';
import { Container, DateTimePicker, Text } from '@zextras/carbonio-design-system';
import { getBridgedFunctions } from '@zextras/carbonio-shell-ui';
import { getBridgedFunctions, useUserSettings } from '@zextras/carbonio-shell-ui';
import moment from 'moment';
import { Dispatch } from '@reduxjs/toolkit';
import ModalFooter from '../../../../sidebar/commons/modal-footer';
Expand Down Expand Up @@ -38,6 +38,7 @@ const SendLaterModal: FC<SendLaterModalPropTypes> = ({ onClose, dispatch, editor
() => bridgedFn?.t('label.schedule_send', 'Schedule send'),
[bridgedFn]
);
const { prefs } = useUserSettings();
const onConfirm = useCallback(() => {
const autoSendTime = moment(time).valueOf();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand All @@ -61,7 +62,7 @@ const SendLaterModal: FC<SendLaterModalPropTypes> = ({ onClose, dispatch, editor
closeBoard();
}
});
}, [bridgedFn, closeBoard, dispatch, editor, onClose, time]);
}, [bridgedFn, closeBoard, dispatch, editor, onClose, prefs, time]);

const minTime = useMemo(() => {
if (moment(time).isBefore(moment(), 'hour') || !time) {
Expand Down

0 comments on commit 955adb7

Please sign in to comment.