Skip to content

Commit

Permalink
fix: WelcomeView restore button not updating (#70)
Browse files Browse the repository at this point in the history
* Fix sync issue

* Bump to v14
  • Loading branch information
joeldavidw authored Oct 6, 2024
1 parent 34cf48e commit 1a38989
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Chronos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 13.0;
MARKETING_VERSION = 14.0;
PRODUCT_BUNDLE_IDENTIFIER = com.joeldavidw.ChronosDevDebug;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -918,7 +918,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 13.0;
MARKETING_VERSION = 14.0;
PRODUCT_BUNDLE_IDENTIFIER = com.joeldavidw.ChronosDevRelease;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1244,7 +1244,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 13.0;
MARKETING_VERSION = 14.0;
PRODUCT_BUNDLE_IDENTIFIER = com.joeldavidw.Chronos;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
2 changes: 0 additions & 2 deletions Chronos/App/Onboarding/WelcomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import SwiftData
import SwiftUI

struct WelcomeView: View {
let swiftDataService = Container.shared.swiftDataService()
let stateService = Container.shared.stateService()

@Query var vaults: [Vault]
Expand Down Expand Up @@ -89,7 +88,6 @@ struct WelcomeView: View {
}
}
.onAppear(perform: {
swiftDataService.resetModelContainers()
iCloudSyncLastAttempt = 0

syncTimer = Timer.scheduledTimer(withTimeInterval: 2.5, repeats: false) { _ in
Expand Down
1 change: 0 additions & 1 deletion Chronos/Services/CryptoService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public class CryptoService {

private let stateService = Container.shared.stateService()
private let vaultService = Container.shared.vaultService()
private let swiftDataService = Container.shared.swiftDataService()

// scrypt paramaters - n: 2^17, r: 8, p: 1
private let kdfParams = KdfParams(type: 0, n: 1 << 17, r: 8, p: 1)
Expand Down
7 changes: 1 addition & 6 deletions Chronos/Services/SwiftDataService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ public class SwiftDataService {
}
}

public func resetModelContainers() {
localModelContainer = setupModelContainer(storeName: "localChronos.sqlite", cloudKitDatabase: .none)
cloudModelContainer = setupModelContainer(storeName: "onlineChronos.sqlite", cloudKitDatabase: .automatic)
}

public func getCloudModelContainer() -> ModelContainer {
return cloudModelContainer
}
Expand Down Expand Up @@ -151,7 +146,7 @@ extension SwiftDataService {

func deleteLocallyPersistedChronosData() {
getLocalModelContainer().deleteAllData()
resetModelContainers()
localModelContainer = setupModelContainer(storeName: "localChronos.sqlite", cloudKitDatabase: .none)
}

func permentalyDeleteAllIcloudData() {
Expand Down

0 comments on commit 1a38989

Please sign in to comment.