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

This commit is contained in:
ansuz 2021-08-26 14:07:03 +05:30
parent 68efd54917
commit dd8f70d6f4
1 changed files with 5 additions and 3 deletions

View File

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