File tree 1 file changed +6
-9
lines changed
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -100,14 +100,11 @@ function lookupSSID(ssid) {
100
100
}
101
101
102
102
function 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 ) ;
111
108
$notification . post ( title , subtitle , content ) ;
112
109
}
113
- }
110
+ }
You can’t perform that action at this time.
0 commit comments