perf(startupService): speedup perceived load time by removing animations before the splashscreen hid

This commit is contained in:
Jason Dreyzehner 2016-10-12 13:27:19 -04:00
commit ec343e4991
4 changed files with 12 additions and 5 deletions

View file

@ -959,6 +959,9 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
$log.info('Init profile...');
// Try to open local profile
profileService.loadAndBindProfile(function(err) {
$ionicHistory.nextViewOptions({
disableAnimate: true
});
if (err) {
if (err.message && err.message.match('NOPROFILE')) {
$log.debug('No profile... redirecting');

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.services').service('startupService', function($log) {
angular.module('copayApp.services').service('startupService', function($log, $timeout) {
var splashscreenVisible = true;
var statusBarVisible = false;
@ -8,7 +8,9 @@ angular.module('copayApp.services').service('startupService', function($log) {
function _hideSplash(){
if(navigator.splashscreen && splashscreenVisible){
$log.debug('startupService is hiding the splashscreen...');
navigator.splashscreen.hide();
$timeout(function(){
navigator.splashscreen.hide();
}, 20);
splashscreenVisible = false;
}
}