iOS client for Grain grain.social
ios photography atproto
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: sync unseen notification count to app icon badge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+5 -1
+5 -1
Grain/ViewModels/NotificationsViewModel.swift
··· 1 1 import Foundation 2 2 import Nuke 3 3 import SwiftUI 4 + import UserNotifications 4 5 5 6 @Observable 6 7 @MainActor 7 8 final class NotificationsViewModel { 8 9 var notifications: [GrainNotification] = [] 9 10 var grouped: [GroupedNotification] = [] 10 - var unseenCount: Int = 0 11 + var unseenCount: Int = 0 { 12 + didSet { UNUserNotificationCenter.current().setBadgeCount(unseenCount) } 13 + } 14 + 11 15 var isLoading = false 12 16 var error: Error? 13 17