Skip to content

Commit

Permalink
fix text
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipthelen committed Oct 14, 2024
1 parent 7377aac commit aed673e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion HabitRPG/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1787,7 +1787,7 @@ public enum L10n {
public enum Faint {
/// Refill Health & Try Again
public static var button: String { return L10n.tr("Mainstrings", "faint.button") }
/// Broken equipment can be repurchased from Rewards
/// Broken equipment can be repurchased from the Market
public static var disclaimer: String { return L10n.tr("Mainstrings", "faint.disclaimer") }
/// Don't despair!
public static var dontDespair: String { return L10n.tr("Mainstrings", "faint.dont_despair") }
Expand Down
20 changes: 10 additions & 10 deletions HabitRPG/TableviewCells/SubscriptionDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,16 @@ class SubscriptionDetailView: UITableViewCell {
private func setCancelDescription(_ plan: SubscriptionPlanProtocol) {
cancelTitleLabel.text = L10n.cancelSubscription
cancelDescriptionButton.isHidden = false
if plan.paymentMethod == "Apple" {
if plan.dateTerminated != nil {
cancelDescriptionButton.setTitle(L10n.renewSubscription, for: .normal)
if plan.isGifted {
cancelDescriptionLabel.text = L10n.renewSubscriptionGiftedDescription
cancelTitleLabel.text = L10n.subscribe
} else {
cancelDescriptionLabel.text = L10n.renewSubscriptionDescription
cancelTitleLabel.text = L10n.resubscribe
}
} else if plan.paymentMethod == "Apple" {
cancelDescriptionLabel.text = L10n.unsubscribeItunes
cancelDescriptionButton.setTitle(L10n.openItunes, for: .normal)
} else if plan.paymentMethod == "Google" {
Expand All @@ -147,15 +156,6 @@ class SubscriptionDetailView: UITableViewCell {
} else if plan.isGroupPlanSub {
cancelDescriptionLabel.text = L10n.cancelSubscriptionGroupPlan
cancelDescriptionButton.isHidden = true
} else if plan.dateTerminated != nil {
cancelDescriptionButton.setTitle(L10n.renewSubscription, for: .normal)
if plan.isGifted {
cancelDescriptionLabel.text = L10n.renewSubscriptionGiftedDescription
cancelTitleLabel.text = L10n.subscribe
} else {
cancelDescriptionLabel.text = L10n.renewSubscriptionDescription
cancelTitleLabel.text = L10n.resubscribe
}
}
}

Expand Down
5 changes: 3 additions & 2 deletions HabitRPG/UI/General/FaintViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ private class ViewModel: ObservableObject {
}

userRepository.getUser()
.take(first: 1)
.on(value: { user in
self.isSubscribed = user.isSubscribed
self.lossText = LocalizedStringKey(L10n.Faint.subtitle(String((user.stats?.level ?? 1) - 1), String(Int(user.stats?.gold ?? 0))))
if self.lossText == "" {
self.lossText = LocalizedStringKey(L10n.Faint.subtitle(String((user.stats?.level ?? 1) - 1), String(Int(user.stats?.gold ?? 0))))
}
}).start()
}

Expand Down

0 comments on commit aed673e

Please sign in to comment.