fix a bug I introduced by not preserving the base case of 'getAuthorId'

pull/1/head
ansuz 3 years ago
parent 68efd54917
commit dd8f70d6f4

@ -252,10 +252,12 @@ define([
funcs.getAuthorId = function(authors, curve, tokenId) { funcs.getAuthorId = function(authors, curve, tokenId) {
var existing = Object.keys(authors || {}).map(Number); var existing = Object.keys(authors || {}).map(Number);
var uid; var uid;
if (!funcs.isLoggedIn()) { var loggedIn = funcs.isLoggedIn();
if (!loggedIn && !tokenId) { return authorUid(existing); }
if (!loggedIn) {
existing.some(function (id) { existing.some(function (id) {
var author = authors[id] || {}; var author = authors[id];
if (author.uid !== tokenId) { return; } if (!author || author.uid !== tokenId) { return; }
uid = Number(id); uid = Number(id);
return true; return true;
}); });

Loading…
Cancel
Save