浏览代码

:bug: Fix multiple docs convert to headings https://github.com/siyuan-note/siyuan/issues/13225

Daniel 6 月之前
父节点
当前提交
d9155c27b6

+ 0 - 1
app/appearance/langs/de_DE.json

@@ -1,5 +1,4 @@
 {
-  "onlyOneDocConvert": "Es kann jeweils nur ein Dokument konvertiert werden",
   "empty": "Leer",
   "newRowInRelation": "Erstellen Sie einen neuen Eintrag in ${x} <b class='ft__on-surface'>${y}</b>",
   "copyKeyContent": "Primärschlüsseltext kopieren",

+ 0 - 1
app/appearance/langs/en_US.json

@@ -1,5 +1,4 @@
 {
-  "onlyOneDocConvert": "Only one document can be converted at a time",
   "empty": "Empty",
   "newRowInRelation": "Create a new entry in ${x} <b class='ft__on-surface'>${y}</b>",
   "copyKeyContent": "Copy primary key text",

+ 0 - 1
app/appearance/langs/es_ES.json

@@ -1,5 +1,4 @@
 {
-  "onlyOneDocConvert": "Solo se puede convertir un documento a la vez",
   "empty": "Vacío",
   "newRowInRelation": "Crear una nueva entrada en ${x} <b class='ft__on-surface'>${y}</b>",
   "copyKeyContent": "Copiar texto de la clave principal",

+ 0 - 1
app/appearance/langs/fr_FR.json

@@ -1,5 +1,4 @@
 {
-  "onlyOneDocConvert": "Vous ne pouvez convertir qu'un seul document à la fois",
   "empty": "Vide",
   "newRowInRelation": "Créer une nouvelle entrée dans ${x} <b class='ft__on-surface'>${y}</b>",
   "copyKeyContent": "Copier le texte de la clé principale",

+ 0 - 1
app/appearance/langs/he_IL.json

@@ -1,5 +1,4 @@
 {
-  "onlyOneDocConvert": "ניתן להמיר רק מסמך אחד בכל פעם",
   "empty": "ריק",
   "newRowInRelation": "צור ערך חדש ב-${x} <b class='ft__on-surface'>${y}</b>",
   "copyKeyContent": "העתק טקסט מפתח ראשי",

+ 0 - 1
app/appearance/langs/it_IT.json

@@ -1,5 +1,4 @@
 {
-  "onlyOneDocConvert": "È possibile convertire solo un documento alla volta",
   "empty": "Vuoto",
   "newRowInRelation": "Crea una nuova voce in ${x} <b class='ft__on-surface'>${y}</b>",
   "copyKeyContent": "Copia il testo della chiave primaria",

+ 0 - 1
app/appearance/langs/ja_JP.json

@@ -1,5 +1,4 @@
 {
-  "onlyOneDocConvert": "一度に変換できるドキュメントは1つだけです",
   "empty": "空白",
   "newRowInRelation": "${x} に新しい項目を作成 <b class='ft__on-surface'>${y}</b>",
   "copyKeyContent": "主キーのテキストをコピー",

+ 0 - 1
app/appearance/langs/pl_PL.json

@@ -1,5 +1,4 @@
 {
-  "onlyOneDocConvert": "Można konwertować tylko jeden dokument na raz",
   "empty": "Pusty",
   "newRowInRelation": "Utwórz nowy wpis w ${x} <b class='ft__on-surface'>${y}</b>",
   "copyKeyContent": "Skopiuj tekst klucza głównego",

+ 0 - 1
app/appearance/langs/ru_RU.json

@@ -1,5 +1,4 @@
 {
-  "onlyOneDocConvert": "Можно конвертировать только один документ за раз",
   "empty": "Пусто",
   "newRowInRelation": "Создать новую запись в ${x} <b class='ft__on-surface'>${y}</b>",
   "copyKeyContent": "Скопировать текст основного ключа",

+ 0 - 1
app/appearance/langs/zh_CHT.json

@@ -1,5 +1,4 @@
 {
-  "onlyOneDocConvert": "每次只能轉換一個文檔",
   "empty": "空白",
   "newRowInRelation": "在 ${x} 中新建條目 <b class='ft__on-surface'>${y}</b>",
   "copyKeyContent": "複製主鍵文本",

+ 0 - 1
app/appearance/langs/zh_CN.json

@@ -1,5 +1,4 @@
 {
-  "onlyOneDocConvert": "每次只能转换一个文档",
   "empty": "空白",
   "newRowInRelation": "在 ${x} 中新建条目 <b class='ft__on-surface'>${y}</b>",
   "copyKeyContent": "复制主键文本",

+ 4 - 0
kernel/model/heading.go

@@ -122,6 +122,8 @@ func Doc2Heading(srcID, targetID string, after bool) (srcTreeBox, srcTreePath st
 		return
 	}
 
+	FlushTxQueue()
+
 	srcTree, _ := LoadTreeByBlockID(srcID)
 	if nil == srcTree {
 		err = ErrBlockNotFound
@@ -274,6 +276,8 @@ func Doc2Heading(srcID, targetID string, after bool) (srcTreeBox, srcTreePath st
 }
 
 func Heading2Doc(srcHeadingID, targetBoxID, targetPath, previousPath string) (srcRootBlockID, newTargetPath string, err error) {
+	FlushTxQueue()
+
 	srcTree, _ := LoadTreeByBlockID(srcHeadingID)
 	if nil == srcTree {
 		err = ErrBlockNotFound

+ 2 - 0
kernel/model/listitem.go

@@ -28,6 +28,8 @@ import (
 )
 
 func ListItem2Doc(srcListItemID, targetBoxID, targetPath, previousPath string) (srcRootBlockID, newTargetPath string, err error) {
+	FlushTxQueue()
+
 	srcTree, _ := LoadTreeByBlockID(srcListItemID)
 	if nil == srcTree {
 		err = ErrBlockNotFound