Skip to content

Commit 6cfb4f8

Browse files
committed
omitting alert when importing document with no commets
1 parent 4ae187a commit 6cfb4f8

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src-tauri/src/kmd.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,6 @@ fn markdown_to_docx(markdown: &str) -> Result<Docx, String> {
651651
}
652652
if in_paragraph {
653653
docx = docx.add_paragraph(current_paragraph);
654-
current_paragraph = Paragraph::new();
655-
in_paragraph = false;
656654
}
657655

658656
// Create heading with appropriate level

src-tauri/src/patch_log.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,19 @@ pub fn import_patches_from_document(
359359
}
360360

361361
fn import_comments(source_conn: &Connection, target_conn: &Connection) -> Result<(), String> {
362+
// Check if comments table exists in source
363+
let table_exists: bool = source_conn
364+
.query_row(
365+
"SELECT count(*) FROM sqlite_master WHERE type='table' AND name='comments'",
366+
[],
367+
|row| row.get(0),
368+
)
369+
.map_err(|e| e.to_string())?;
370+
371+
if !table_exists {
372+
return Ok(());
373+
}
374+
362375
// Ensure target table exists
363376
init_comments_table(target_conn)?;
364377

0 commit comments

Comments
 (0)