Skip to content

Commit

Permalink
IOS-2456 Drop cache method
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatovv committed Apr 1, 2024
1 parent 6767fb9 commit 4cf54aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Anytype/Sources/ServiceLayer/Auth/LoginStateService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final class LoginStateService: LoginStateServiceProtocol {

func setupStateAfterLoginOrAuth(account: AccountData) async {
middlewareConfigurationProvider.setupConfiguration(account: account)
_ = try? await membershipService.getTiers(noCache: true) // To update cache
try? await membershipService.dropTiersCache()

await startSubscriptions()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public protocol MembershipServiceProtocol {
func makeStatusFromMiddlewareModel(membership: MiddlewareMemberhsipStatus) async throws -> MembershipStatus

func getTiers(noCache: Bool) async throws -> [MembershipTier]
func dropTiersCache() async throws


func getVerificationEmail(data: EmailVerificationData) async throws
Expand Down Expand Up @@ -56,6 +57,10 @@ final class MembershipService: MembershipServiceProtocol {
.invoke().tiers.filter { !$0.isTest }.compactMap { $0.asModel() }
}

func dropTiersCache() async throws {
_ = try await getTiers(noCache: true)
}

public func getVerificationEmail(data: EmailVerificationData) async throws {
try await ClientCommands.membershipGetVerificationEmail(.with {
$0.email = data.email
Expand Down

0 comments on commit 4cf54aa

Please sign in to comment.