diff options
| author | Dustin Mierau <dustin@mierau.me> | 2024-05-03 13:04:56 -0700 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2024-05-03 13:04:56 -0700 |
| commit | 5d61fbfd67c3f59bcffa997590d1bc7d41e61528 (patch) | |
| tree | 799877739a5b5c80d8381352897ce3510f71d8d3 /Hotline/Models/Hotline.swift | |
| parent | 02b452ccaf54cb24eb38fcb752126888994c0a1b (diff) | |
Remember banner toolbar displayed state. Clean up use of preferences throughout project.
Diffstat (limited to 'Hotline/Models/Hotline.swift')
| -rw-r--r-- | Hotline/Models/Hotline.swift | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Hotline/Models/Hotline.swift b/Hotline/Models/Hotline.swift index beed6a3..564845a 100644 --- a/Hotline/Models/Hotline.swift +++ b/Hotline/Models/Hotline.swift @@ -673,7 +673,7 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate { self.deleteAllTransfers() } else if status == .loggedIn { - if Prefs().playSounds && Prefs().playLoggedInSound { + if Prefs.shared.playSounds && Prefs.shared.playLoggedInSound { SoundEffectPlayer.shared.playSoundEffect(.loggedIn) } } @@ -772,7 +772,7 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate { let user = self.users.remove(at: existingUserIndex) self.chat.append(ChatMessage(text: "\(user.name) left", type: .status, date: Date())) - if Prefs().playSounds && Prefs().playLeaveSound { + if Prefs.shared.playSounds && Prefs.shared.playLeaveSound { SoundEffectPlayer.shared.playSoundEffect(.userLogout) } } @@ -857,7 +857,7 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate { let transfer = self.transfers[i] transfer.fileURL = at transfer.downloadCallback?(transfer, at) - if Prefs().playSounds && Prefs().playFileTransferCompleteSound { + if Prefs.shared.playSounds && Prefs.shared.playFileTransferCompleteSound { SoundEffectPlayer.shared.playSoundEffect(.transferComplete) } } @@ -881,7 +881,7 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate { } else { if !self.users.isEmpty { - if Prefs().playSounds && Prefs().playJoinSound { + if Prefs.shared.playSounds && Prefs.shared.playJoinSound { SoundEffectPlayer.shared.playSoundEffect(.userLogin) } } |