-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NT-449] Update pledge disclaimer #907
Conversation
…update-pledge-disclaimer
…update-pledge-disclaimer
…update-pledge-disclaimer
…update-pledge-disclaimer
…update-pledge-disclaimer
…update-pledge-disclaimer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done! I just left a few comments, but nothing serious. 🌟
@@ -141,13 +141,15 @@ public class PledgeViewModel: PledgeViewModelType, PledgeViewModelInputs, Pledge | |||
} | |||
.skipNil() | |||
|
|||
self.confirmationLabelAttributedText = Signal.merge( | |||
let initialProjectAndProject = Signal.merge( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the initialProjectAndProject
are the same project, but emitted in different times and this can end up becoming misleading. Maybe something like this would be better?
let projectAndPledgeTotal = Signal.merge(
project,
project.takeWhen(self.traitCollectionDidChangeSignal)
)
.combineLatest(with: pledgeTotal)
self.confirmationLabelAttributedText = projectAndPledgeTotal
.ksr_debounce(.milliseconds(10), on: AppEnvironment.current.scheduler)
.map(attributedConfirmationString(with:pledgeTotal:))
.skipNil()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I forgot to change that naming 🤦🏾♀️ .Thanks for improving!
], | ||
documentAttributes: nil | ||
) else { return nil } | ||
if project.stats.currentCurrency == project.stats.currency { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make this function a bit smaller, we could extract this to a new function that returns a String based on the currencies.
) | ||
} | ||
|
||
let attributedString: NSMutableAttributedString = NSMutableAttributedString.init(string: fullString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, the syntax without .init
would be preferred (NSMutableAttributedString(string: fullString))
|> \.month .~ 11 | ||
|> \.day .~ 1 | ||
|> \.year .~ 2_019 | ||
|> \.timeZone .~ TimeZone.init(secondsFromGMT: 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this code was already here, but could you get rid of the .init
s here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sheep it!
📲 What
We are now showing a disclaimer when updating pledge in different currency.
🤔 Why
So that users understand that they are about to be charged in a foreign currency and foreign transaction fees may apply.
🛠 How
Checking to see if the user's currency matches the project's. If not we show the conversion label otherwise we don't.
👀 See
✅ Acceptance criteria