From dffe5d2c0b7969a0ce5f7af4a3719b43c0d1320f Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Wed, 15 May 2019 16:41:13 -0400 Subject: #817 don't update image if authSession is being negotiated --- www/js/app.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'www/js/app.js') diff --git a/www/js/app.js b/www/js/app.js index 9df47f23..303467be 100755 --- a/www/js/app.js +++ b/www/js/app.js @@ -491,8 +491,8 @@ angular.module('zmApp', [ // This directive is adapted from https://github.com/paveisistemas/ionic-image-lazy-load // I've removed lazyLoad and only made it show a spinner when an image is loading //-------------------------------------------------------------------------------------------- - .directive('imageSpinnerSrc', ['$document', '$compile', 'imageLoadingDataShare', '$timeout', '$parse', - function ($document, $compile, imageLoadingDataShare, $timeout, $parse) { + .directive('imageSpinnerSrc', ['$document', '$compile', 'imageLoadingDataShare', '$timeout', '$parse', 'NVR', '$rootScope', + function ($document, $compile, imageLoadingDataShare, $timeout, $parse, NVR, $rootScope) { return { restrict: 'A', scope: { @@ -618,7 +618,15 @@ angular.module('zmApp', [ bgImg.src = $attributes.imageSpinnerSrc; } else { - $element[0].src = $attributes.imageSpinnerSrc; // set src attribute on element (it will load image) + + var ld = NVR.getLogin(); + if (ld.isUseAuth && $rootScope.authSession=='' ) { + NVR.log ("waiting for authSession to have a value..."); + + } else { + $element[0].src = $attributes.imageSpinnerSrc; // set src + } + } } -- cgit v1.2.3