LN-Zap / zap-iOS

Zap Wallet - Native iOS lightning wallet focused on user experience and ease of use ⚡️
http://zaphq.io
MIT License
181 stars 47 forks source link

feature: displaying a warning before opening a block explorer link #326

Open chitowncrispy opened 4 years ago

chitowncrispy commented 4 years ago

Description

I added a new UIAlertController to display an alert to the user when they tap on a block explorer link. I also made a slight refactor to remove the delegate that is passed into EventDetailViewModel.swift. I replaced it with a more reactive approach to more fully embrace that style of programming within the app.

Motivation and Context

This is to address issue #125.

How Has This Been Tested?

On the iOS simulator, I went to the history page, tapped on a transaction and then tapped on both transaction hashes as well as addresses. I verified that the cancel button dismissed the alert in both cases. I also verified that the continue button took us to the correct block explorer page in both instances.

I also went to the channel page and tapped on the funding transactions. I verified that the cancel button dismissed the alert. I also verified that the continue button took us to the correct block explorer page.

Screenshots (if appropriate):

Screen Shot 2019-11-16 at 10 37 34 PM Screen Shot 2019-11-16 at 10 37 45 PM

Types of changes

Checklist:

codecov-io commented 4 years ago

Codecov Report

Merging #326 into master will decrease coverage by 0.14%. The diff coverage is 17.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #326      +/-   ##
==========================================
- Coverage   10.71%   10.56%   -0.15%     
==========================================
  Files         247      247              
  Lines        9803     9827      +24     
==========================================
- Hits         1050     1038      -12     
- Misses       8753     8789      +36
Impacted Files Coverage Δ
Library/Extensions/UserDefaults.swift 0% <ø> (ø) :arrow_up:
Library/Generated/strings.swift 6.97% <ø> (ø) :arrow_up:
Library/Coordinators/WalletCoordinator.swift 0% <0%> (ø) :arrow_up:
Library/Extensions/UIAlertController.swift 0% <0%> (ø) :arrow_up:
...nes/History/Detail/EventDetailViewController.swift 0% <0%> (ø) :arrow_up:
Library/Tests/EventDetailViewModelTests.swift 97.36% <100%> (+2.49%) :arrow_up:
...y/Scenes/History/Detail/EventDetailViewModel.swift 36.29% <62.5%> (-1.93%) :arrow_down:
...htning/Services/Misc/BlockChainHeightUpdater.swift 60.41% <0%> (-20.84%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update efa92e2...9e6c4ec. Read the comment docs.

ottosuess commented 4 years ago

Greenwallet has an option to turn that alert off. that's pretty nice for users who don't care about that notification.

We can just store that in the UserDefaults. (https://github.com/LN-Zap/zap-iOS/blob/master/Library/Extensions/UserDefaults.swift).

Image from iOS (2)

chitowncrispy commented 4 years ago
Screen Shot 2019-11-22 at 10 37 01 AM