fix undefined on mobile

This commit is contained in:
Tom
2023-05-26 21:09:45 +02:00
parent b1db4f1776
commit 24e1e9d9d8
5 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -225,7 +225,7 @@ const ReplyModal = ({ isOpen, closeModal }) => {
</div>
<div id="form">
<div>
{account.author?.displayName ? (
{account && account.author && account.author.displayName ? (
<input id="name" type="text" value={account.author?.displayName} ref={nameRef} disabled />
) : (
<input id="name" type="text" placeholder="Anonymous" ref={nameRef} />
+2 -2
View File
@@ -639,8 +639,8 @@ const Board = () => {
<tr data-type="Name">
<td id="td-name">Name</td>
<td>
{account.author.displayName ? (
<input name="name" type="text" tabIndex={1} value={account.author.displayName} ref={nameRef} disabled />
{account && account.author && account.author.displayName ? (
<input name="name" type="text" tabIndex={1} value={account.author?.displayName} ref={nameRef} disabled />
) : (
<input name="name" type="text" placeholder="Anonymous" tabIndex={1} ref={nameRef} />
)}
+2 -2
View File
@@ -565,8 +565,8 @@ const Catalog = () => {
<tr data-type="Name">
<td id="td-name">Name</td>
<td>
{account.author.displayName ? (
<input name="name" type="text" tabIndex={1} value={account.author.displayName} ref={nameRef} disabled />
{account && account.author && account.author.displayName ? (
<input name="name" type="text" tabIndex={1} value={account.author?.displayName} ref={nameRef} disabled />
) : (
<input name="name" type="text" placeholder="Anonymous" tabIndex={1} ref={nameRef} />
)}
+2 -2
View File
@@ -285,7 +285,7 @@ const Pending = () => {
&nbsp;
&nbsp;
<span className="poster-address">
(u/{account.author.shortAddress})
(u/{account.author?.shortAddress})
</span>
&nbsp;
<span className="date-time" data-utc="data">{getDate(comment?.timestamp)}</span>
@@ -326,7 +326,7 @@ const Pending = () => {
Anonymous</span>}
&nbsp;
<span key={`mob-pa-${"pending"}`} className="poster-address-mobile">
(u/{account.author.shortAddress})&nbsp;
(u/{account.author?.shortAddress})&nbsp;
</span>
<br key={`mob-br1-${"pending"}`} />
{comment.title ? (
+2 -2
View File
@@ -614,8 +614,8 @@ const Thread = () => {
<tr data-type="Name">
<td id="td-name">Name</td>
<td>
{account.author.displayName ? (
<input name="name" type="text" tabIndex={1} value={account.author.displayName} ref={nameRef} disabled />
{account && account.author && account.author.displayName ? (
<input name="name" type="text" tabIndex={1} value={account.author?.displayName} ref={nameRef} disabled />
) : (
<input name="name" type="text" placeholder="Anonymous" tabIndex={1} ref={nameRef} />
)}