From dd8f70d6f457e2a2afa30a710139ddb16fe26417 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 26 Aug 2021 14:07:03 +0530 Subject: [PATCH] fix a bug I introduced by not preserving the base case of 'getAuthorId' --- www/common/sframe-common.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/www/common/sframe-common.js b/www/common/sframe-common.js index 01c48b540..000d049b3 100644 --- a/www/common/sframe-common.js +++ b/www/common/sframe-common.js @@ -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; });