Skip to content

Commit

Permalink
Update teambuilder after team load if it's open
Browse files Browse the repository at this point in the history
  • Loading branch information
mia-pi-git committed Sep 29, 2023
1 parent 65726aa commit 4fe4526
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,12 @@ function toId() {
});

this.on('loggedin', function () {
Storage.loadRemoteTeams();
Storage.loadRemoteTeams(function () {
if (app.rooms.teambuilder) {
// if they have it open, be sure to update so it doesn't show 'no teams'
app.rooms.teambuilder.update();
}
});
});

this.on('response:savereplay', this.uploadReplay, this);
Expand Down
3 changes: 2 additions & 1 deletion js/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ Storage.loadTeams = function () {
} catch (e) {}
};

Storage.loadRemoteTeams = function () {
Storage.loadRemoteTeams = function (after) {
$.get(app.user.getActionPHP(), {act: 'getteams'}, Storage.safeJSON(function (data) {
if (data.actionerror) {
return app.addPopupMessage('Error loading uploaded teams: ' + data.actionerror);
Expand Down Expand Up @@ -615,6 +615,7 @@ Storage.loadRemoteTeams = function () {
Storage.teams.push(team);
}
}
if (typeof after === 'function') after();
}));
};

Expand Down

0 comments on commit 4fe4526

Please sign in to comment.