From 24bae4025d46d3d1c2d40e81a272add436f4c418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jess=C3=A9=20Monteiro?= Date: Thu, 30 May 2024 15:26:42 -0300 Subject: [PATCH] fix: build problems --- TikiClient/Classes/TikiClient.swift | 2 +- TikiClient/Classes/UI/Offer.swift | 4 +++- TikiClient/Classes/UI/OfferFlow.swift | 12 ++++-------- .../Classes/UI/Screens/OfferAllowTraking.swift | 6 +++--- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/TikiClient/Classes/TikiClient.swift b/TikiClient/Classes/TikiClient.swift index 899f6ec..af4a0f8 100644 --- a/TikiClient/Classes/TikiClient.swift +++ b/TikiClient/Classes/TikiClient.swift @@ -171,7 +171,7 @@ public class TikiClient { } public static func createOffer(_id: String?, ptr: String?, description: String?, terms: String?, reward: [Reward], use: Use, tags: [Tag], permissions: [Permission?]){ - self.offer = Offer(_id: _id, ptr: ptr, description: description, terms: terms, reward: reward, use: use, tags: tags, permissions: permissions) + self.offer = Offer(_id: _id, ptr: ptr, description: description, terms: terms, reward: reward, use: use, tags: tags, permissions: permissions, mutable: true) } public static func acceptOffer(completion: @escaping (String?) -> Void, onError: @escaping (String) -> Void){ if(offer == nil){ diff --git a/TikiClient/Classes/UI/Offer.swift b/TikiClient/Classes/UI/Offer.swift index e356be2..47a46fd 100644 --- a/TikiClient/Classes/UI/Offer.swift +++ b/TikiClient/Classes/UI/Offer.swift @@ -36,9 +36,10 @@ public class Offer { public var use: Use public var tags = [Tag]() public var permissions = [Permission?]() + public var mutable: Bool - public init(_id: String? = nil, ptr: String? = nil, description: String? = nil, terms: String? = nil, reward: [Reward] = [Reward](), use: Use, tags: [Tag] = [Tag](), permissions: [Permission?] = [Permission?]()) { + public init(_id: String? = nil, ptr: String? = nil, description: String? = nil, terms: String? = nil, reward: [Reward] = [Reward](), use: Use, tags: [Tag] = [Tag](), permissions: [Permission?] = [Permission?](), mutable: Bool) { self._id = _id self.ptr = ptr self.description = description @@ -47,6 +48,7 @@ public class Offer { self.use = use self.tags = tags self.permissions = permissions + self.mutable = mutable } /// The Offer unique identifier. If none is set, it creates a random UUID. diff --git a/TikiClient/Classes/UI/OfferFlow.swift b/TikiClient/Classes/UI/OfferFlow.swift index f79fa3b..3eeeb49 100644 --- a/TikiClient/Classes/UI/OfferFlow.swift +++ b/TikiClient/Classes/UI/OfferFlow.swift @@ -1,21 +1,17 @@ import SwiftUI public struct OfferFlow: View{ - @ObservedObject public static var step = OfferStepFollow(offerFollowSteps: .none) + @ObservedObject public static var step = OfferStepFollow(offerFollowSteps: .permissions) public init() {} public var body: some View{ switch(OfferFlow.step.offerFollowSteps){ - case .none: + case .permissions: OfferAllowTrackView() - case .allowTrackAsk: - OfferAllowTrackView() - case .linkCard: + case .offers: OfferLinkCardView() - case .deniedLinkCard: + case .settings: OfferLinkCardView() - case .deniedTrack: - OfferAllowTrackView() } } diff --git a/TikiClient/Classes/UI/Screens/OfferAllowTraking.swift b/TikiClient/Classes/UI/Screens/OfferAllowTraking.swift index 66cb8b4..fc7bc3e 100644 --- a/TikiClient/Classes/UI/Screens/OfferAllowTraking.swift +++ b/TikiClient/Classes/UI/Screens/OfferAllowTraking.swift @@ -73,11 +73,11 @@ public struct OfferAllowTrackView: View { case .restricted: print("restricted") case .denied: - OfferFlow.step.offerFollowSteps = .allowTrackAsk + OfferFlow.step.offerFollowSteps = .permissions case .authorized: - OfferFlow.step.offerFollowSteps = .linkCard + OfferFlow.step.offerFollowSteps = .offers default: - OfferFlow.step.offerFollowSteps = .allowTrackAsk + OfferFlow.step.offerFollowSteps = .permissions } }) } label: {