Skip to content

Commit

Permalink
Need to work in the Showing and hiding the announce view
Browse files Browse the repository at this point in the history
Haven’t figured out how to show and hide the AnnounceView then show the tabVC

- Sometimes it reads the evaluation and sometimes it doesnt
- removed the current user signup sheet

Signed-off-by: kcw-grunt <[email protected]>
  • Loading branch information
kcw-grunt committed Jan 14, 2024
1 parent d255c7a commit 6153a03
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 146 deletions.
2 changes: 2 additions & 0 deletions litewallet/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ class MainViewController: UIViewController, Subscriber, LoginViewControllerDeleg
}

func didUnlockLogin() {
let hasSeenAnnounce = UserDefaults.standard.bool(forKey: hasSeenAnnounceView)

guard let tabVC = UIStoryboard(name: "Main", bundle: nil)
.instantiateViewController(withIdentifier: "TabBarViewController")
as? TabBarViewController
Expand Down
7 changes: 0 additions & 7 deletions litewallet/StartViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,6 @@ class StartViewModel: ObservableObject {
didTapRecover = completion
}

func didAddToMailingList(email: String, preference: LanguageSelection) {
let signupDict: [String: String] = ["user_email": email,
"date_accepted": Date().ISO8601Format(),
"language_pref": preference.code]
LWAnalytics.logEventWithParameters(itemName: ._20240101_US, properties: signupDict)
}

private func checkForWalletAndSync() {
/// Test seed count
guard seedWords.count == 12 else { return }
Expand Down
1 change: 0 additions & 1 deletion litewallet/TransactionCellViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class TransactionCellViewModel: ObservableObject {
feeText = transaction.amountDetails(isLtcSwapped: isLtcSwapped, rate: rate, rates: [rate], maxDigits: maxDigits)

addressText = String(format: transaction.direction.addressTextFormat, transaction.toAddress ?? "DEBUG-UPDATED-ADDRESS")
print("::: toAddress: \(transaction.toAddress) raw : \(transaction.rawTransaction)")

if transaction.direction == .sent {
directionImageText = "arrowtriangle.up.circle.fill"
Expand Down
19 changes: 3 additions & 16 deletions litewallet/src/AnnounceUpdatesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,9 @@ struct AnnounceUpdatesView: View {
@EnvironmentObject
var viewModel: StartViewModel

@State
private var emailAddress = ""

@State
private var didComplete = false

@State
private var isEmailValid = false

@State
private var languagePref: LanguageSelection = .English

Expand All @@ -28,8 +22,6 @@ struct AnnounceUpdatesView: View {
@Binding
var didTapContinue: Bool

private var signupViewModel = SignupWebViewModel()

let navigateStart: NavigateStart

let paragraphFont: Font = .barlowSemiBold(size: 22.0)
Expand Down Expand Up @@ -79,16 +71,14 @@ struct AnnounceUpdatesView: View {
.onTapGesture {
isEmailFieldFocused.toggle()
}
SignupWebView(viewModel: signupViewModel,
url: URL(string: C.signupURL)!,
userAction: $didComplete)

SignupWebView(userAction: $didComplete,
urlString: C.signupURL)
.frame(width: width)
.frame(height: pageHeight)
.edgesIgnoringSafeArea(.all)
.padding(.bottom, smallLabelPad)
.onChange(of: didComplete) { updateValue in
print("::: updateValue \(updateValue)")

if updateValue {
switch navigateStart {
case .create:
Expand Down Expand Up @@ -126,9 +116,6 @@ struct AnnounceUpdatesView: View {
}
}
.padding(.bottom, genericPad)
.onAppear {
print("::: height \(height)")
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions litewallet/src/ApplicationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import UIKit
let timeSinceLastExitKey = "TimeSinceLastExit"
let shouldRequireLoginTimeoutKey = "ShouldRequireLoginTimeoutKey"
let numberOfLitewalletLaunches = "NumberOfLitewalletLaunches"
let hasSeenAnnounceView = "HasSeedAnnounceView"
let LITEWALLET_APP_STORE_ID = 1_119_332_592

class ApplicationController: Subscriber, Trackable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ extension ApplicationController {
if UserDefaults.standard.object(forKey: shouldRequireLoginTimeoutKey) == nil {
UserDefaults.standard.set(60.0 * 3.0, forKey: shouldRequireLoginTimeoutKey) // Default 3 min timeout
}
if UserDefaults.standard.object(forKey: hasSeenAnnounceView) == nil {
UserDefaults.standard.set(false, forKey: hasSeenAnnounceView) // Hasnt seen the Announce View
}
}

func countLaunches() {
Expand Down
Loading

0 comments on commit 6153a03

Please sign in to comment.