Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix the Notification Type is not applied after changing it from WebUI #297

Merged
merged 1 commit into from
Jun 4, 2023

Conversation

zthxxx
Copy link
Collaborator

@zthxxx zthxxx commented Jun 4, 2023

问题现象:

  • 在 WebUI 上修改 Notification Token,并同时修改 Notification Type 从 telegrambrak 并 Apply 后,
  • 配置文件确实看到改了,但后台发送到请求还是走到 telegram,并且使用的新改的 Token
  • 也就是只有 Notification Type 修改没生效

问题来源: tg 群内 @ZIZNAH, Close #288

原因与修复:

  • 通知方式实际被 PostNotification 获取 client 类型的函数 getClient 的默认参数闭包固定住了
  • 于是 settings.notification.type 的更新值并不会对 getClient 函数生效
  • 修改为每次在 PostNotification 内初始化时显示传递 settings.notification.type 来示实例化一个通知客户端

Copy link
Owner

@EstrellaXD EstrellaXD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, thanks for the contribution

@EstrellaXD EstrellaXD merged commit 2a7f58d into EstrellaXD:3.0-dev Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants