Skip to content

Commit

Permalink
Prevent the "Mute" menu item from being incorrectly displayed as mark…
Browse files Browse the repository at this point in the history
…ed while paused
  • Loading branch information
LIJI32 committed Aug 25, 2024
1 parent c7c54ab commit 430e42f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Cocoa/Document.m
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,12 @@ - (bool) isPaused
- (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)anItem
{
if ([anItem action] == @selector(mute:)) {
[(NSMenuItem *)anItem setState:!_audioClient.isPlaying];
if (_running) {
[(NSMenuItem *)anItem setState:!_audioClient.isPlaying];
}
else {
[(NSMenuItem *)anItem setState:[[NSUserDefaults standardUserDefaults] boolForKey:@"Mute"]];
}
}
else if ([anItem action] == @selector(togglePause:)) {
[(NSMenuItem *)anItem setState:self.isPaused];
Expand Down

0 comments on commit 430e42f

Please sign in to comment.