Explorar el Código

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

Vanessa hace 2 años
padre
commit
7d41575c2f

+ 1 - 1
app/src/block/Panel.ts

@@ -140,7 +140,7 @@ export class BlockPanel {
             pinElement.classList.add("block__icon--active");
             pinElement.setAttribute("aria-label", window.siyuan.languages.unpin);
             this.element.setAttribute("data-pin", "true");
-        })
+        });
         /// #endif
         this.render();
     }

+ 12 - 1
app/src/config/bazaar.ts

@@ -491,8 +491,19 @@ export const bazaar = {
                                 });
                                 return;
                             }
-                            bazaar._genMyHTML(bazaarType, app);
                             bazaar._onBazaar(response, bazaarType, ["themes", "icons"].includes(bazaarType));
+                            bazaar._genMyHTML(bazaarType, app);
+                            if (bazaarType === "plugins") {
+                                confirmDialog(window.siyuan.languages.confirm, window.siyuan.languages.enablePluginTip, () => {
+                                    fetchPost("/api/petal/setPetalEnabled", {
+                                        packageName: dataObj.name,
+                                        enabled: true,
+                                    }, (response) => {
+                                        loadPlugin(app, response.data);
+                                        bazaar._genMyHTML(bazaarType, app);
+                                    });
+                                });
+                            }
                         });
                     }
                     event.preventDefault();

+ 3 - 3
app/src/dialog/moveResize.ts

@@ -4,8 +4,8 @@ import {Constants} from "../constants";
 export const moveResize = (element: HTMLElement, afterCB?: (type: string) => void) => {
     element.addEventListener("mousedown", (event: MouseEvent & { target: HTMLElement }) => {
         let iconsElement = hasClosestByClassName(event.target, "resize__move");
-        let x: number
-        let y: number
+        let x: number;
+        let y: number;
         const elementRect = element.getBoundingClientRect();
         if (!iconsElement) {
             x = event.clientX;
@@ -124,4 +124,4 @@ export const moveResize = (element: HTMLElement, afterCB?: (type: string) => voi
             }
         };
     });
-}
+};

+ 1 - 1
app/src/layout/dock/Tag.ts

@@ -90,7 +90,7 @@ export class Tag extends Model {
                 openGlobalSearch(app, `#${element.getAttribute("data-label")}#`, !window.siyuan.ctrlIsPressed);
             },
             rightClick: (element: HTMLElement, event: MouseEvent) => {
-                openTagMenu(element, event, element.getAttribute("data-label"))
+                openTagMenu(element, event, element.getAttribute("data-label"));
             },
             blockExtHTML: window.siyuan.config.readonly ? undefined : '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>',
             topExtHTML: window.siyuan.config.readonly ? undefined : '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>'

+ 1 - 1
app/src/util/mount.ts

@@ -3,7 +3,7 @@ import {showMessage} from "../dialog/message";
 import {isMobile} from "./functions";
 import {fetchPost} from "./fetch";
 import {Dialog} from "../dialog";
-import {getNotebookName, getOpenNotebookCount} from "./pathName";
+import {getOpenNotebookCount} from "./pathName";
 import {validateName} from "../editor/rename";
 import {setStorageVal} from "../protyle/util/compatibility";