@@ -69,6 +69,7 @@ export class PomodoroTimer {
6969 private randomNotificationEndSound : HTMLAudioElement = null ;
7070
7171 private systemNotificationEnabled : boolean = true ; // 新增:系统弹窗开关
72+ private randomNotificationSystemNotificationEnabled : boolean = true ; // 新增:随机提示音系统通知开关
7273
7374 private isFullscreen : boolean = false ; // 新增:全屏模式状态
7475 private escapeKeyHandler : ( ( e : KeyboardEvent ) => void ) | null = null ; // 新增:ESC键监听器
@@ -90,6 +91,7 @@ export class PomodoroTimer {
9091
9192 // 初始化随机提示音设置
9293 this . randomNotificationEnabled = settings . randomNotificationEnabled || false ;
94+ this . randomNotificationSystemNotificationEnabled = settings . randomNotificationSystemNotification !== false ; // 新增
9395
9496 // 初始化自动模式设置
9597 this . autoMode = settings . autoMode || false ;
@@ -297,7 +299,7 @@ export class PomodoroTimer {
297299 await selectedAudio . play ( ) ;
298300
299301 // 新增:显示系统通知
300- if ( this . systemNotificationEnabled ) {
302+ if ( this . randomNotificationSystemNotificationEnabled ) {
301303 this . showSystemNotification (
302304 t ( 'randomNotificationSettings' ) ,
303305 t ( 'randomRest' )
@@ -323,7 +325,7 @@ export class PomodoroTimer {
323325 await this . randomNotificationEndSound . play ( ) ;
324326
325327 // 新增:播放结束声音后显示系统通知
326- if ( this . systemNotificationEnabled ) {
328+ if ( this . randomNotificationSystemNotificationEnabled ) {
327329 this . showSystemNotification (
328330 t ( 'randomNotificationSettings' ) ,
329331 t ( 'randomRestComplete' ) || '微休息时间结束,可以继续专注工作了!'
@@ -343,7 +345,7 @@ export class PomodoroTimer {
343345 await this . randomNotificationEndSound . play ( ) ;
344346
345347 // 新增:在延迟播放时也显示系统通知
346- if ( this . systemNotificationEnabled ) {
348+ if ( this . randomNotificationSystemNotificationEnabled ) {
347349 this . showSystemNotification (
348350 t ( 'randomNotificationSettings' ) ,
349351 t ( 'randomRestComplete' ) || '微休息时间结束,可以继续专注工作了!'
@@ -354,7 +356,7 @@ export class PomodoroTimer {
354356 console . debug ( '延迟播放随机提示音结束声音失败,这是预期的浏览器安全限制' ) ;
355357
356358 // 即使音频播放失败,也要显示系统通知
357- if ( this . systemNotificationEnabled ) {
359+ if ( this . randomNotificationSystemNotificationEnabled ) {
358360 this . showSystemNotification (
359361 t ( 'randomNotificationSettings' ) ,
360362 t ( 'randomRestComplete' ) || '微休息时间结束,可以继续专注工作了!'
0 commit comments