apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 986 forks source link

Hide splash sceen without `SplashScreenDelay` on .hide() #1006

Closed BendingBender closed 3 years ago

BendingBender commented 3 years ago

Fixes #991

Platforms affected

iOS

Motivation and Context

The cordova-plugin-splash-screen allowed to hide the splash screen as a race between the timeout specified in the SplashScreenDelay preference and the call to navigator.splashscreen.hide() in JS code. This was very desirable, it allowed to show the splash screen for a long time if the application took a long time to boot but not too long so that users wouldn't think that the application is hanging.

Since the reimplementation of this functionality here, the behavior has changed. Now, the SplashScreenDelay preference applies to calls made by navigator.splashscreen.hide(), defeating the behavior described above.

Description

Make hiding of splash screen again a race between the timeout specified in SplashScreenDelay setting and navigator.splashscreen.hide() call.

Testing

Manual tests in simulator and real device (iPhone X).

Checklist

dpogue commented 3 years ago

Thanks for the PR @BendingBender! 🎉

This looks good with a quick skim over it, I'll take a more thorough look tomorrow.

codecov-io commented 3 years ago

Codecov Report

Merging #1006 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1006   +/-   ##
=======================================
  Coverage   74.91%   74.91%           
=======================================
  Files          13       13           
  Lines        1718     1718           
=======================================
  Hits         1287     1287           
  Misses        431      431           

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 1d06c0a...1391b0b. Read the comment docs.