Prechádzať zdrojové kódy

Skip volume-button stop teardown when monitoring was never started (#612)

Previously alarmStopped() always logged "Alarm stop detected" under the
Volume Button Snooze category and ran the teardown, even when the
volume-button-snooze feature was disabled and the matching
alarmStarted() had early-returned. The result was a misleading log line
on every alarm event for users who don't use volume-button snooze.

Guard alarmStopped() on isMonitoring so it only runs when the volume
observer was actually started. The "Invalidating volume observer." log
inside stopMonitoring() now serves as the single, accurate teardown
entry.
Jonas Björkert 3 mesiacov pred
rodič
commit
edf5996a93

+ 1 - 1
LoopFollow/Controllers/VolumeButtonHandler.swift

@@ -106,7 +106,7 @@ class VolumeButtonHandler: NSObject {
     }
     }
 
 
     private func alarmStopped() {
     private func alarmStopped() {
-        LogManager.shared.log(category: .volumeButtonSnooze, message: "Alarm stop detected")
+        guard isMonitoring else { return }
 
 
         alarmStartTime = nil
         alarmStartTime = nil
         stopMonitoring()
         stopMonitoring()