Skip to content

Commit

Permalink
🎨 #10804
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Mar 31, 2024
1 parent c80ceb6 commit 487e2f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions app/src/ai/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ const editDialog = (customName: string, customMemo: string) => {
const customElement = dialog.element.querySelector("textarea");
const btnsElement = dialog.element.querySelectorAll(".b3-button");
dialog.bindInput(customElement, () => {
(btnsElement[1] as HTMLButtonElement).click();
(btnsElement[2] as HTMLButtonElement).click();
});
customElement.value = customMemo;
btnsElement[0].addEventListener("click", () => {
btnsElement[1].addEventListener("click", () => {
dialog.destroy();
});
btnsElement[1].addEventListener("click", () => {
btnsElement[2].addEventListener("click", () => {
window.siyuan.storage[Constants.LOCAL_AI].find((subItem: {
name: string,
memo: string
Expand All @@ -67,7 +67,7 @@ const editDialog = (customName: string, customMemo: string) => {
});
dialog.destroy();
});
btnsElement[2].addEventListener("click", () => {
btnsElement[0].addEventListener("click", () => {
window.siyuan.storage[Constants.LOCAL_AI].find((subItem: {
name: string,
memo: string
Expand Down
8 changes: 4 additions & 4 deletions app/src/menus/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ const editLayout = (layoutName?: string) => {
inputElement.select();
inputElement.focus();
dialog.bindInput(inputElement, () => {
btnsElement[1].dispatchEvent(new CustomEvent("click"));
btnsElement[2].dispatchEvent(new CustomEvent("click"));
});
btnsElement[0].addEventListener("click", () => {
btnsElement[1].addEventListener("click", () => {
dialog.destroy();
});
btnsElement[1].addEventListener("click", () => {
btnsElement[2].addEventListener("click", () => {
const value = inputElement.value;
if (!value) {
showMessage(window.siyuan.languages["_kernel"]["142"]);
Expand Down Expand Up @@ -88,7 +88,7 @@ const editLayout = (layoutName?: string) => {
});
setStorageVal(Constants.LOCAL_LAYOUTS, window.siyuan.storage[Constants.LOCAL_LAYOUTS]);
});
btnsElement[2].addEventListener("click", () => {
btnsElement[0].addEventListener("click", () => {
window.siyuan.storage[Constants.LOCAL_LAYOUTS].find((layoutItem: ISaveLayout, index: number) => {
if (layoutItem.name === layoutName) {
window.siyuan.storage[Constants.LOCAL_LAYOUTS].splice(index, 1);
Expand Down

0 comments on commit 487e2f9

Please sign in to comment.