|
|
@@ -106,14 +106,14 @@ export const HandsontableModal = (): JSX.Element => {
|
|
|
|
|
|
const handleModalOpen = () => {
|
|
|
let markdownTableState;
|
|
|
- if (table == null) {
|
|
|
- // markdowntable state from Editor
|
|
|
- markdownTableState = getMarkdownTable(editor);
|
|
|
- }
|
|
|
- else {
|
|
|
+ if (table != null || editor == null) {
|
|
|
// markdowntable state from View
|
|
|
markdownTableState = table;
|
|
|
}
|
|
|
+ else {
|
|
|
+ // markdowntable state from Editor
|
|
|
+ markdownTableState = getMarkdownTable(editor);
|
|
|
+ }
|
|
|
const initTableInstance = markdownTableState == null ? defaultMarkdownTable : markdownTableState.clone();
|
|
|
setMarkdownTable(markdownTableState ?? defaultMarkdownTable);
|
|
|
setMarkdownTableOnInit(initTableInstance);
|