Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
frostime committed Oct 28, 2023
2 parents 0fb07e2 + 9252807 commit d48b0cb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
5 changes: 3 additions & 2 deletions plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 管理 + 移动块功能",
Expand All @@ -27,5 +27,6 @@
"custom": [
"https://afdian.net/a/frostime"
]
}
},
"keywords": ["dailynote", "diary", "日记", "笔记", "日程", "TODO", "预约", "reservation"]
}
12 changes: 11 additions & 1 deletion src/func/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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');
}

Expand Down

0 comments on commit d48b0cb

Please sign in to comment.