Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public enum DashModelContainer {
PersistentProperty.self,
PersistentTokenHistoryEvent.self,
PersistentPlatformAddress.self,
PersistentSyncState.self,
PersistentPlatformAddressesSyncState.self,
PersistentWallet.self,
PersistentAccount.self,
PersistentCoreAddress.self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import SwiftData
/// can resume from where it left off on app restart instead of doing
/// a full trunk/branch/compact rescan.
@Model
public final class PersistentSyncState {
public final class PersistentPlatformAddressesSyncState {
/// Stable 32-byte scope key for this sync-state row.
///
/// Kept as `walletId` for schema compatibility, but the persisted
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -581,12 +581,12 @@ struct BalanceCardView: View {
/// shared across every wallet on that network — so this query
/// filters by `network` rather than `walletId`. Used only to
/// distinguish "synced with zero balance" from "never synced".
@Query private var syncStates: [PersistentSyncState]
@Query private var syncStates: [PersistentPlatformAddressesSyncState]

init(wallet: PersistentWallet) {
self.wallet = wallet
let walletId = wallet.walletId
// `PersistentSyncState.network` is a required AppNetwork;
// `PersistentPlatformAddressesSyncState.network` is a required AppNetwork;
// `.testnet` is a harmless sentinel for wallets that haven't
// had their network stamped yet — they won't have a matching
// sync state row either, so the query naturally returns empty.
Expand All @@ -597,7 +597,7 @@ struct BalanceCardView: View {
filter: #Predicate<PersistentPlatformAddress> { $0.walletId == walletId }
)
_syncStates = Query(
filter: #Predicate<PersistentSyncState> { $0.networkRaw == walletNetworkRaw }
filter: #Predicate<PersistentPlatformAddressesSyncState> { $0.networkRaw == walletNetworkRaw }
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ struct StorageExplorerView: View {
) {
PlatformAddressStorageListView()
}
modelRow("Sync State", icon: "arrow.triangle.2.circlepath", type: PersistentSyncState.self) {
SyncStateStorageListView()
modelRow("Platform Addresses Sync State", icon: "arrow.triangle.2.circlepath", type: PersistentPlatformAddressesSyncState.self) {
PlatformAddressesSyncStateStorageListView()
}
modelRow("Wallets", icon: "wallet.pass", type: PersistentWallet.self) {
WalletStorageListView()
Expand Down Expand Up @@ -142,7 +142,7 @@ struct StorageExplorerView: View {
count(PersistentIndex.self)
count(PersistentProperty.self)
count(PersistentKeyword.self)
count(PersistentSyncState.self)
count(PersistentPlatformAddressesSyncState.self)
count(PersistentWallet.self)
count(PersistentAccount.self)
count(PersistentTransaction.self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,15 +445,15 @@ struct KeywordStorageListView: View {
}
}

// MARK: - PersistentSyncState
// MARK: - PersistentPlatformAddressesSyncState

struct SyncStateStorageListView: View {
@Query(sort: \PersistentSyncState.lastUpdated, order: .reverse)
private var records: [PersistentSyncState]
struct PlatformAddressesSyncStateStorageListView: View {
@Query(sort: \PersistentPlatformAddressesSyncState.lastUpdated, order: .reverse)
private var records: [PersistentPlatformAddressesSyncState]

var body: some View {
List(records) { record in
NavigationLink(destination: SyncStateStorageDetailView(record: record)) {
NavigationLink(destination: PlatformAddressesSyncStateStorageDetailView(record: record)) {
VStack(alignment: .leading, spacing: 4) {
Text(record.network.displayName)
.font(.body)
Expand All @@ -466,7 +466,7 @@ struct SyncStateStorageListView: View {
}
}
}
.navigationTitle("Sync State (\(records.count))")
.navigationTitle("Platform Addresses Sync State (\(records.count))")
.overlay { if records.isEmpty { ContentUnavailableView("No Records", systemImage: "arrow.triangle.2.circlepath") } }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,10 @@ struct KeywordStorageDetailView: View {
}
}

// MARK: - PersistentSyncState
// MARK: - PersistentPlatformAddressesSyncState

struct SyncStateStorageDetailView: View {
let record: PersistentSyncState
struct PlatformAddressesSyncStateStorageDetailView: View {
let record: PersistentPlatformAddressesSyncState

private var blockDate: Date? {
record.syncTimestamp > 0
Expand Down Expand Up @@ -445,7 +445,7 @@ struct SyncStateStorageDetailView: View {
FieldRow(label: "Record Updated", value: dateString(record.lastUpdated))
}
}
.navigationTitle("Sync State")
.navigationTitle("Platform Addresses Sync State")
.navigationBarTitleDisplayMode(.inline)
}
}
Expand Down
Loading