Skip to content

Commit a646078

Browse files
committed
fix needFullScan
1 parent cc2e69d commit a646078

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

BDKSwiftExampleWallet.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
77F6A9E52DE24841003568F0 /* URL+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77F6A9E42DE24837003568F0 /* URL+Extensions.swift */; };
1717
77F6A9E72DE248A2003568F0 /* EsploraService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77F6A9E62DE248A1003568F0 /* EsploraService.swift */; };
1818
77F6A9E92DE25C9C003568F0 /* KyotoService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77F6A9E82DE25C98003568F0 /* KyotoService.swift */; };
19+
77F6A9EB2DE5072E003568F0 /* AppStorageUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77F6A9EA2DE50727003568F0 /* AppStorageUtil.swift */; };
1920
A733D6D02A81113000F333B4 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = A733D6CF2A81113000F333B4 /* Localizable.xcstrings */; };
2021
A73F7A362A3B778E00B87FC6 /* Int+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A73F7A352A3B778E00B87FC6 /* Int+Extensions.swift */; };
2122
AE0C30F72A804A2D008F1EAE /* TransactionListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE0C30F62A804A2D008F1EAE /* TransactionListView.swift */; };
@@ -125,6 +126,7 @@
125126
77F6A9E42DE24837003568F0 /* URL+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URL+Extensions.swift"; sourceTree = "<group>"; };
126127
77F6A9E62DE248A1003568F0 /* EsploraService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EsploraService.swift; sourceTree = "<group>"; };
127128
77F6A9E82DE25C98003568F0 /* KyotoService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KyotoService.swift; sourceTree = "<group>"; };
129+
77F6A9EA2DE50727003568F0 /* AppStorageUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppStorageUtil.swift; sourceTree = "<group>"; };
128130
A733D6CF2A81113000F333B4 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
129131
A73F7A352A3B778E00B87FC6 /* Int+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Int+Extensions.swift"; sourceTree = "<group>"; };
130132
AE0C30F62A804A2D008F1EAE /* TransactionListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionListView.swift; sourceTree = "<group>"; };
@@ -321,6 +323,7 @@
321323
AE1C34202A42441F008F807A /* Utilities */ = {
322324
isa = PBXGroup;
323325
children = (
326+
77F6A9EA2DE50727003568F0 /* AppStorageUtil.swift */,
324327
AE79538D2A2D59F000CCB277 /* Constants.swift */,
325328
AE2F255C2BED0BFB002A9AC6 /* AppError.swift */,
326329
);
@@ -769,6 +772,7 @@
769772
AE6716012A9AC089005C193F /* KeyServiceError.swift in Sources */,
770773
77AD9F062DBB031D00182E65 /* ActivityHomeHeaderView.swift in Sources */,
771774
AE0C30FB2A804B95008F1EAE /* WalletViewModel.swift in Sources */,
775+
77F6A9EB2DE5072E003568F0 /* AppStorageUtil.swift in Sources */,
772776
AE49847C2A1BBBD6009951E2 /* BDKSwiftExampleWalletApp.swift in Sources */,
773777
AE6715FF2A9AC066005C193F /* FeeServiceError.swift in Sources */,
774778
AE2381AD2C60578500F6B00C /* ActivityListView.swift in Sources */,

BDKSwiftExampleWallet/Service/BDK Service/BDKService.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ private class BDKService {
151151

152152
extension BDKService {
153153
func needsFullScanOfWallet() -> Bool {
154-
return needsFullScan
154+
return StorageUtil.shared.isNeedFullScan ?? true
155155
}
156156

157157
func setNeedsFullScan(_ value: Bool) {
158-
needsFullScan = value
158+
StorageUtil.shared.isNeedFullScan = value
159159
}
160160
}
161161

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//
2+
// AppStorageUtil.swift
3+
// BDKSwiftExampleWallet
4+
//
5+
// Created by Rubens Machion on 26/05/25.
6+
//
7+
8+
import SwiftUI
9+
10+
struct StorageUtil {
11+
@AppStorage("isNeedFullScan") var isNeedFullScan: Bool?
12+
13+
static var shared = StorageUtil()
14+
}

0 commit comments

Comments
 (0)