Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Bug 1062114: double-check that we're still hidden before exiting
Browse files Browse the repository at this point in the history
  • Loading branch information
David Flanagan authored and rvandermeulen committed Oct 23, 2014
1 parent fd859ec commit 1e48e3e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion apps/gallery/js/gallery.js
Expand Up @@ -1417,7 +1417,14 @@ function doNotScanInBackgroundHack(photodb) {
// wait a bit for the log to be flushed, and then close the application
if (document.hidden && photodb.scanning) {
console.warn('[Gallery] exiting to avoid background scan.');
setTimeout(function() { window.close(); }, 500);
setTimeout(function() {
if (document.hidden) {
window.close();
}
else {
console.warn('[Gallery] now visible again, so not exiting');
}
}, 500);
}
}
}
Expand Down

0 comments on commit 1e48e3e

Please sign in to comment.