Quellcode durchsuchen

:art: fix https://github.com/siyuan-note/siyuan/issues/11889

Vanessa vor 1 Jahr
Ursprung
Commit
8f03464726
2 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen
  1. 2 0
      app/src/editor/rename.ts
  2. 1 1
      app/src/layout/Tab.ts

+ 2 - 0
app/src/editor/rename.ts

@@ -137,12 +137,14 @@ export const renameAsset = (assetPath: string) => {
         fetchPost("/api/asset/renameAsset", {oldPath: assetPath, newName: inputElement.value}, (response) => {
             getAllModels().asset.forEach(item => {
                 if (item.path === assetPath) {
+                    item.path = response.data.newPath;
                     item.parent.updateTitle(getDisplayName(response.data.newPath));
                 }
             });
             getAllEditor().forEach(item => {
                 item.reload(false);
             });
+            dialog.destroy();
         });
     });
 };

+ 1 - 1
app/src/layout/Tab.ts

@@ -67,7 +67,7 @@ export class Tab {
                         this.headElement.setAttribute("aria-label", escapeGreat(response.data));
                     });
                 } else {
-                    this.headElement.setAttribute("aria-label", escapeGreat(options.title));
+                    this.headElement.setAttribute("aria-label", escapeGreat(this.title));
                 }
             });
             this.headElement.addEventListener("dragstart", (event: DragEvent & { target: HTMLElement }) => {