File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -100,14 +100,11 @@ function lookupSSID(ssid) {
100100}
101101
102102function notify ( title , subtitle , content ) {
103- const TIMESTAMP_KEY = "running_mode_notified_time" ;
104- const THROTTLE_TIME = 3 * 1000 ;
105- const lastNotifiedTime = $persistentStore . read ( THROTTLE_TIME ) ;
106- if (
107- ! lastNotifiedTime ||
108- new Date ( ) . getTime ( ) - lastNotifiedTime > THROTTLE_TIME
109- ) {
110- $persistentStore . write ( new Date ( ) . getTime ( ) . toString ( ) , TIMESTAMP_KEY ) ;
103+ const SUBTITLE_STORE_KEY = "running_mode_notified_subtitle" ;
104+ const lastNotifiedSubtitle = $persistentStore . read ( SUBTITLE_STORE_KEY ) ;
105+
106+ if ( ! lastNotifiedSubtitle || lastNotifiedSubtitle !== subtitle ) {
107+ $persistentStore . write ( subtitle . toString ( ) , SUBTITLE_STORE_KEY ) ;
111108 $notification . post ( title , subtitle , content ) ;
112109 }
113- }
110+ }
You can’t perform that action at this time.
0 commit comments