Skip to content

Commit

Permalink
No need for the check I guess
Browse files Browse the repository at this point in the history
  • Loading branch information
egilkh committed Oct 1, 2015
1 parent 24b2f4c commit 87fa4c7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ngStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,8 @@
$window.addEventListener && $window.addEventListener('storage', function(event) {
// Reference doc.
var doc = $document[0];
// Figure out if hasFocus / hasFocus() exists.
var hasDocFocus = angular.isDefined(doc.hasFocus);

if ( ( hasDocFocus ? (!doc.hasFocus || !doc.hasFocus()) : true ) && storageKeyPrefix === event.key.slice(0, prefixLength) ) {
if ( (!doc.hasFocus || !doc.hasFocus()) && storageKeyPrefix === event.key.slice(0, prefixLength) ) {
event.newValue ? $storage[event.key.slice(prefixLength)] = deserializer(event.newValue) : delete $storage[event.key.slice(prefixLength)];

_last$storage = angular.copy($storage);
Expand Down

0 comments on commit 87fa4c7

Please sign in to comment.