Skip to content

Commit 939b1da

Browse files
committed
修复 **通知服务**,超阈不再发送通知
1 parent f6ea276 commit 939b1da

2 files changed

Lines changed: 17 additions & 19 deletions

File tree

CHANGELOG/v2.3.0-beta.2/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ v2.3 - Shiroko (砂狼白子) beta 2
2121
- 修复 **点名/抽奖**,重置后人数标签不更新
2222
- 修复 **半重复**,重置后历史缓存未刷新
2323
- 修复 **抽奖小组模式**,多项显示缺失
24-
- 修复 **通知服务**超阈仍发ClassIsland
24+
- 修复 **通知服务**超阈不再发送通知
2525

2626
## 🔧 其它变更
2727

app/common/notification/notification_service.py

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ def show_roll_call_result(
12131213
is_animating: 是否在动画过程中,如果是则不启动自动关闭定时器
12141214
"""
12151215
notification_service_type = 0
1216-
suppress_secrandom_notification = False
1216+
exceed_threshold = False
12171217
if settings_group:
12181218
try:
12191219
notification_service_type = readme_settings_async(
@@ -1230,12 +1230,14 @@ def show_roll_call_result(
12301230
max_notify_count = readme_settings_async(
12311231
settings_group, "main_window_display_threshold"
12321232
)
1233-
if use_main_window_when_exceed_threshold and int(draw_count or 0) > int(
1234-
max_notify_count or 0
1235-
):
1236-
suppress_secrandom_notification = True
1233+
exceed_threshold = use_main_window_when_exceed_threshold and int(
1234+
draw_count or 0
1235+
) > int(max_notify_count or 0)
12371236
except Exception:
1238-
suppress_secrandom_notification = False
1237+
exceed_threshold = False
1238+
1239+
if exceed_threshold:
1240+
return
12391241

12401242
# 如果选择了ClassIsland通知服务,则发送到ClassIsland
12411243
if notification_service_type == 1: # 1 表示 ClassIsland 通知服务
@@ -1245,7 +1247,6 @@ def show_roll_call_result(
12451247
draw_count,
12461248
settings,
12471249
settings_group,
1248-
fallback_on_error=not suppress_secrandom_notification,
12491250
is_animating=is_animating,
12501251
)
12511252
return
@@ -1262,19 +1263,16 @@ def show_roll_call_result(
12621263
fallback_on_error=False,
12631264
is_animating=is_animating,
12641265
)
1265-
if suppress_secrandom_notification:
1266-
return
12671266

12681267
# 否则使用SecRandom浮窗通知
1269-
if not suppress_secrandom_notification:
1270-
self._show_secrandom_notification(
1271-
class_name,
1272-
selected_students,
1273-
draw_count,
1274-
settings,
1275-
settings_group,
1276-
is_animating,
1277-
)
1268+
self._show_secrandom_notification(
1269+
class_name,
1270+
selected_students,
1271+
draw_count,
1272+
settings,
1273+
settings_group,
1274+
is_animating,
1275+
)
12781276

12791277
def close_all_notifications(self):
12801278
"""关闭所有浮动通知窗口"""

0 commit comments

Comments
 (0)