Skip to content

Commit

Permalink
✨ feat: 使用 Alt+5 打开日记之后,检查预约情况
Browse files Browse the repository at this point in the history
  • Loading branch information
frostime committed Sep 13, 2024
1 parent 33fbaf7 commit 859b4f9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- 🔨 refactor: Dock 栏改为基于查询的方案获取预约信息
- 🔥 rm: 去掉一些基于 reservation 对象的代码,为后面弃用 reservation 对象做准备
- ✨ feat: 使用 Alt+5 打开日记之后,检查预约情况

## [2024-09-09] v1.6.7

Expand Down
4 changes: 3 additions & 1 deletion src/func/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ export class RoutineEventHandler {
*/
public async tryAutoInsertResv() {
//TODO 允许用户配置是否每次打开都尝试更新预约
if (this.flag.hasAutoInsertResv === true) return;
// v1.6.8 Note: 把这里的限制去掉,让每次打开的时候都尝试插入预约
// 后期看看要不要优化一下
// if (this.flag.hasAutoInsertResv === true) return;

//如果今天没有预约,就不插入
let hasResv = await isTodayReserved();
Expand Down
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ export default class DailyNoteTodayPlugin extends Plugin {
langKey: 'open-dn',
langText: this.i18n.Open,
hotkey: '⌥5',
callback: openDefaultDailyNote
callback: () => {
//v1.6.8 Note: 在快捷键打开日记之后,同样检查预约情况
openDefaultDailyNote().then(() => {
this.routineHandler.tryAutoInsertResv();
});
}
});
toggleGeneralDailynoteKeymap(false);
} else {
Expand Down

0 comments on commit 859b4f9

Please sign in to comment.