Clear four compiler warnings in E2EInbox and TodayStore
Three @Published properties carried internal(set) on an internal property, which changes nothing. forgetOnThisPhone defaulted its store to .shared, evaluated outside the main actor; it now takes an optional and resolves .shared inside the body. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
a50d12722f
commit
abd2a557e9
@@ -542,13 +542,13 @@ final class E2EInbox: ObservableObject {
|
||||
|
||||
/// Section 17.6 and 8.9d, see `E2EInbox+AccountState.swift`. Written only
|
||||
/// through `writeSync` and the merge of what linked devices send.
|
||||
@Published internal(set) var syncState = SyncState()
|
||||
@Published var syncState = SyncState()
|
||||
/// Section 17.3: the code this device is showing so a linked device can
|
||||
/// link it, and when it stops being good. Memory only: ten minutes, one
|
||||
/// use.
|
||||
@Published internal(set) var pendingLinkCode: (code: DeviceLinkCode, expires: Date)?
|
||||
@Published var pendingLinkCode: (code: DeviceLinkCode, expires: Date)?
|
||||
/// A numeric-fallback offer held until the person confirms the number here.
|
||||
@Published internal(set) var pendingNumericOffer: PendingLinkOffer?
|
||||
@Published var pendingNumericOffer: PendingLinkOffer?
|
||||
/// What the person is told about changes to the linked set.
|
||||
@Published var linkNotices: [LinkNotice] = []
|
||||
/// Section 17.6: ops written here, waiting to go to the linked devices.
|
||||
|
||||
@@ -393,8 +393,10 @@ final class TodayStore: ObservableObject {
|
||||
/// other traces. The file is public; the picks say where somebody cares
|
||||
/// about, and the next person to use this phone has no business with
|
||||
/// either.
|
||||
static func forgetOnThisPhone(_ store: TodayStore = .shared, defaults: UserDefaults = .standard) {
|
||||
store.forgetEverything()
|
||||
/// `store` is optional because a default of `.shared` is evaluated
|
||||
/// outside the main actor, which Swift 6 refuses.
|
||||
static func forgetOnThisPhone(_ store: TodayStore? = nil, defaults: UserDefaults = .standard) {
|
||||
(store ?? .shared).forgetEverything()
|
||||
defaults.removeObject(forKey: TodayPlaces.key)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user