Fix recsys submission when user
is null (#54)
## Issue 44 tor browser crash related to recsys? ## Reproduce the exact error Block the request for `me|new` in dev tools ## Fix The code was trying to destructure a null object. The existing code seems to indicate that null ID is expected (it uses null as fallback), so this change shouldn't impact recsys results (I didn't check the recsys docs to confirm).
This commit is contained in:
parent
a168dbcc01
commit
6f3c43c95f
2 changed files with 3 additions and 1 deletions
|
@ -97,6 +97,7 @@
|
|||
"About --[tab title in Channel Page]--": "About",
|
||||
"About --[link title in Sidebar or Footer]--": "About",
|
||||
"Community Guidelines": "Community Guidelines",
|
||||
"FAQ and Support": "FAQ and Support",
|
||||
"Share Channel": "Share Channel",
|
||||
"Go to page:": "Go to page:",
|
||||
"Enter a URL for your thumbnail.": "Enter a URL for your thumbnail.",
|
||||
|
|
|
@ -92,7 +92,8 @@ const recsys = {
|
|||
createRecsysEntry: function (claimId, parentUuid) {
|
||||
if (window && window.store && claimId) {
|
||||
const state = window.store.getState();
|
||||
const { id: userId } = selectUser(state);
|
||||
const user = selectUser(state);
|
||||
const userId = user ? user.id : null;
|
||||
if (parentUuid) {
|
||||
// Make a stub entry that will be filled out on page load
|
||||
recsys.entries[claimId] = {
|
||||
|
|
Loading…
Reference in a new issue