Fix join team for anon users

This commit is contained in:
yflory
2019-12-18 13:05:01 +01:00
parent 8eed376274
commit a817242fe5
6 changed files with 33 additions and 2 deletions

View File

@@ -1149,8 +1149,18 @@ define([
};
nThen(function (waitFor) {
// XXX XXX Check number of teams first!
APP.module.execCommand("GET_PREVIEW_CONTENT", {
// Get preview content.
// Use the team module if we're logged in, or sframeChan if we're not
var f = function (data, cb) {
if (driveAPP.loggedIn) {
return void APP.module.execCommand('GET_PREVIEW_CONTENT', data, cb);
}
var sframeChan = common.getSframeChannel();
sframeChan.query('Q_ANON_GET_PREVIEW_CONTENT', data, function (err, json) {
cb(json);
});
};
f({
seeds: seeds,
}, waitFor(function (json) {
if (json && json.error) { // XXX this is failing with "team is disabled"