Skip to content

Commit

Permalink
#817 don't update image if authSession is being negotiated
Browse files Browse the repository at this point in the history
  • Loading branch information
pliablepixels committed May 15, 2019
1 parent e0df954 commit 4bbd91c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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
}


}
}
Expand Down

0 comments on commit 4bbd91c

Please sign in to comment.