From 0c68f3ee3739f0f2f9608a03d020b220f0663744 Mon Sep 17 00:00:00 2001 From: frostime Date: Sat, 28 Oct 2023 21:35:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix=20=E5=A4=9A=E7=AA=97=E5=8F=A3=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=EF=BC=8C=E4=BD=BF=E7=94=A8=E9=A1=B6=E6=A0=8F?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=89=93=E5=BC=80=E6=97=A5=E8=AE=B0=E7=9A=84?= =?UTF-8?q?=E8=A1=8C=E4=B8=BA=EF=BC=8C=E4=BC=9A=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E5=B9=BF=E6=92=AD=E5=88=B0=E6=89=80=E6=9C=89=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E4=B8=AD=20close=20#171?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ src/func/index.ts | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b67fd21..3dff9b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### [2023-10-28] v1.2.10 + +- fix bug 多窗口模式下,使用顶栏菜单打开日记的行为,会错误的广播到所有窗口 [#171](https://github.com/frostime/siyuan-dailynote-today/issues/171) + ### [2023-10-22] v1.2.9 - 优化合并重复日记的策略 [#167](https://github.com/frostime/siyuan-dailynote-today/issues/167) diff --git a/src/func/index.ts b/src/func/index.ts index dce9fc6..7fb785d 100644 --- a/src/func/index.ts +++ b/src/func/index.ts @@ -5,6 +5,7 @@ import { showMessage, confirm, Dialog, openTab } from 'siyuan'; import notebooks from '../global-notebooks'; import { info, warn, error, i18n, lute, app, isMobile, formatBlockTime, debug } from "../utils"; import * as serverApi from '../serverApi'; +import * as utils from '@/utils'; import { reservation, settings } from '../global-status'; import { Retrieve, RetvFactory } from './reserve'; import { getDailynoteSprig, renderDailynotePath } from './dailynote'; @@ -267,7 +268,16 @@ export async function createDiary(notebook: Notebook, todayDiaryHpath: string) { * @param notebook_index 笔记本的 index */ export async function openDiary(notebook: Notebook) { - await serverApi.createDailyNote(notebook.id, ""); + console.log(utils.app) + //@ts-ignore + const ws_url: string = window.siyuan.ws.ws.url; + const appIdReg = /app=(\w+)&/ + let match = ws_url.match(appIdReg); + let appId = ""; //https://github.com/frostime/siyuan-dailynote-today/issues/171 + if (match) { + appId = match[1]; + } + await serverApi.createDailyNote(notebook.id, appId); showMessage(`${i18n.Open}: ${notebook.name}`, 2000, 'info'); } From 92528076464277dace5cc56454e176ad8e524e1b Mon Sep 17 00:00:00 2001 From: frostime Date: Sat, 28 Oct 2023 21:36:13 +0800 Subject: [PATCH 2/2] misc --- plugin.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin.json b/plugin.json index b35587e..8f62e1b 100644 --- a/plugin.json +++ b/plugin.json @@ -6,7 +6,7 @@ "en_US": "Daily Note Today" }, "url": "https://github.com/frostime/siyuan-dailynote-today", - "version": "1.2.9", + "version": "1.2.10", "minAppVersion": "2.10.6", "description": { "zh_CN": "自动创建日记 + 快速打开日记 + 日程 TODO 管理 + 移动块功能", @@ -27,5 +27,6 @@ "custom": [ "https://afdian.net/a/frostime" ] - } + }, + "keywords": ["dailynote", "diary", "日记", "笔记", "日程", "TODO", "预约", "reservation"] }