Skip to content

Commit a22fcde

Browse files
committed
refactor: self guard 문 처리
1 parent abd6c00 commit a22fcde

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

DevLog/App/Delegate/AppDelegate.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,17 @@ private extension AppDelegate {
197197
let listener = store.collection("users/\(uid)/notifications")
198198
.whereField("isRead", isEqualTo: false)
199199
.addSnapshotListener { [weak self] snapshot, error in
200+
guard let self else { return }
200201
if let error {
201-
self?.logger.error("Failed to observe unread notification count", error: error)
202+
self.logger.error("Failed to observe unread notification count", error: error)
202203
subject.send(completion: .failure(error))
203204
return
204205
}
205206

206207
guard let snapshot else { return }
207208

208209
let unreadNotificationCount = snapshot.documents.count
209-
self?.logger.info("Observed unread notification count: \(unreadNotificationCount)")
210+
self.logger.info("Observed unread notification count: \(unreadNotificationCount)")
210211
subject.send(unreadNotificationCount)
211212
}
212213

0 commit comments

Comments
 (0)