You can now hit LOGOUT while photos are loading
Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
parent
626295c94c
commit
a6ab1074dc
@ -540,12 +540,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
logout: function(event) {
|
logout: function(event) {
|
||||||
if (this.loading) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.loading = true;
|
|
||||||
window.fetch("api/v1/users/logout", function(error, xhr) {
|
window.fetch("api/v1/users/logout", function(error, xhr) {
|
||||||
this.loading = false;
|
|
||||||
this.user = null;
|
this.user = null;
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
@ -1051,6 +1046,10 @@
|
|||||||
window.fetch("api/v1/photos" + path + query, function(path, error, xhr) {
|
window.fetch("api/v1/photos" + path + query, function(path, error, xhr) {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
||||||
|
if (!this.user) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ((mode != this.mode) ||
|
if ((mode != this.mode) ||
|
||||||
((mode == "albums") && (path != (this.path || ""))) ||
|
((mode == "albums") && (path != (this.path || ""))) ||
|
||||||
((mode == "memories") && (path != ("/memories/" + (this.date || ""))))) {
|
((mode == "memories") && (path != ("/memories/" + (this.date || ""))))) {
|
||||||
@ -1104,6 +1103,11 @@
|
|||||||
var path = this.path || "";
|
var path = this.path || "";
|
||||||
window.fetch("api/v1/albums" + path, function(path, error, xhr) {
|
window.fetch("api/v1/albums" + path, function(path, error, xhr) {
|
||||||
this.loadingAlbums = false;
|
this.loadingAlbums = false;
|
||||||
|
|
||||||
|
if (!this.user) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (path != (this.path || "")) {
|
if (path != (this.path || "")) {
|
||||||
console.log("Skipping results for old query. Triggering re-fetch of albums for new path.");
|
console.log("Skipping results for old query. Triggering re-fetch of albums for new path.");
|
||||||
this._loadAlbums();
|
this._loadAlbums();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user