From 19da52f1c7315e82471b6b9a9eebabd8751f41cc Mon Sep 17 00:00:00 2001 From: Hailey Date: Wed, 10 Jul 2024 17:49:54 -0700 Subject: [PATCH] lint more --- modules/BlueskyNSE/NotificationService.swift | 18 +++++++++--------- .../ShareViewController.swift | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/BlueskyNSE/NotificationService.swift b/modules/BlueskyNSE/NotificationService.swift index f863eaf223..384180d8b0 100644 --- a/modules/BlueskyNSE/NotificationService.swift +++ b/modules/BlueskyNSE/NotificationService.swift @@ -13,43 +13,43 @@ class NotificationService: UNNotificationServiceExtension { contentHandler(request.content) return } - + if reason == "chat-message" { mutateWithChatMessage(bestAttempt) } else { mutateWithBadge(bestAttempt) } - + contentHandler(bestAttempt) } - + override func serviceExtensionTimeWillExpire() { // If for some reason the alloted time expires, we don't actually want to display a notification } - + func createCopy(_ content: UNNotificationContent) -> UNMutableNotificationContent? { return content.mutableCopy() as? UNMutableNotificationContent } - + func mutateWithBadge(_ content: UNMutableNotificationContent) { var count = prefs?.integer(forKey: "badgeCount") ?? 0 count += 1 - + // Set the new badge number for the notification, then store that value for using later content.badge = NSNumber(value: count) prefs?.setValue(count, forKey: "badgeCount") } - + func mutateWithChatMessage(_ content: UNMutableNotificationContent) { if self.prefs?.bool(forKey: "playSoundChat") == true { mutateWithDmSound(content) } } - + func mutateWithDefaultSound(_ content: UNMutableNotificationContent) { content.sound = UNNotificationSound.default } - + func mutateWithDmSound(_ content: UNMutableNotificationContent) { content.sound = UNNotificationSound(named: UNNotificationSoundName(rawValue: "dm.aiff")) } diff --git a/modules/Share-with-Bluesky/ShareViewController.swift b/modules/Share-with-Bluesky/ShareViewController.swift index 9e34010a76..c045d578fe 100644 --- a/modules/Share-with-Bluesky/ShareViewController.swift +++ b/modules/Share-with-Bluesky/ShareViewController.swift @@ -120,8 +120,8 @@ class ShareViewController: UIViewController { let filePath = "\(dir.absoluteString)\(ProcessInfo.processInfo.globallyUniqueString).jpeg" if let newUri = URL(string: filePath), - let jpegData = image.jpegData(compressionQuality: 1) - try jpegData.write(to: newUri) + let jpegData = image.jpegData(compressionQuality: 1) { + try jpegData.write(to: newUri) return "\(newUri.absoluteString)|\(image.size.width)|\(image.size.height)" } }