Page MenuHomePhorge

D6473.1768778529.diff
No OneTemporary

Size
3 KB
Referenced Files
None
Subscribers
None

D6473.1768778529.diff

diff --git a/lib/shared/entry-utils.js b/lib/shared/entry-utils.js
--- a/lib/shared/entry-utils.js
+++ b/lib/shared/entry-utils.js
@@ -48,7 +48,7 @@
month: rawEntryInfo.month,
day: rawEntryInfo.day,
creationTime: rawEntryInfo.creationTime,
- creator: creatorInfo && creatorInfo.username,
+ creator: creatorInfo,
deleted: rawEntryInfo.deleted,
};
}
diff --git a/lib/types/entry-types.js b/lib/types/entry-types.js
--- a/lib/types/entry-types.js
+++ b/lib/types/entry-types.js
@@ -12,7 +12,7 @@
ServerCreateUpdatesResponse,
ClientCreateUpdatesResponse,
} from './update-types';
-import type { AccountUserInfo } from './user-types';
+import type { UserInfo, AccountUserInfo } from './user-types';
export type RawEntryInfo = {
id?: string, // null if local copy without ID yet
@@ -36,7 +36,7 @@
month: number, // 1-indexed
day: number, // 1-indexed
creationTime: number, // millisecond timestamp
- creator: ?string,
+ creator: ?UserInfo,
deleted: boolean,
};
diff --git a/web/modals/history/history-entry.react.js b/web/modals/history/history-entry.react.js
--- a/web/modals/history/history-entry.react.js
+++ b/web/modals/history/history-entry.react.js
@@ -8,6 +8,7 @@
restoreEntryActionTypes,
restoreEntry,
} from 'lib/actions/entry-actions';
+import { useENSNames } from 'lib/hooks/ens-cache';
import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors';
import { threadInfoSelector } from 'lib/selectors/thread-selectors';
import { colorIsDark } from 'lib/shared/thread-utils';
@@ -19,6 +20,7 @@
} from 'lib/types/entry-types';
import type { LoadingStatus } from 'lib/types/loading-types';
import type { ThreadInfo } from 'lib/types/thread-types';
+import type { UserInfo } from 'lib/types/user-types';
import {
type DispatchActionPromise,
useDispatchActionPromise,
@@ -43,6 +45,7 @@
+calendarQuery: () => CalendarQuery,
+dispatchActionPromise: DispatchActionPromise,
+restoreEntry: (info: RestoreEntryInfo) => Promise<RestoreEntryResult>,
+ +creator: ?UserInfo,
};
class HistoryEntry extends React.PureComponent<Props> {
@@ -82,14 +85,11 @@
[css.darkEntry]: colorIsDark(this.props.threadInfo.color),
});
const textStyle = { backgroundColor: '#' + this.props.threadInfo.color };
- const creator =
- this.props.entryInfo.creator === null ? (
- 'Anonymous'
- ) : (
- <span className={css.entryUsername}>
- {this.props.entryInfo.creator}
- </span>
- );
+ const creator = this.props.creator?.username ? (
+ <span className={css.entryUsername}>{this.props.creator.username}</span>
+ ) : (
+ 'anonymous'
+ );
return (
<li>
@@ -162,19 +162,23 @@
`${restoreEntryActionTypes.started}:${entryID}`,
),
);
- const calanderQuery = useSelector(nonThreadCalendarQuery);
+ const calenderQuery = useSelector(nonThreadCalendarQuery);
const callRestoreEntry = useServerCall(restoreEntry);
const dispatchActionPromise = useDispatchActionPromise();
+ const { creator } = props.entryInfo;
+ const [creatorWithENSName] = useENSNames([creator]);
+
return (
<HistoryEntry
{...props}
threadInfo={threadInfo}
loggedIn={loggedIn}
restoreLoadingStatus={restoreLoadingStatus}
- calendarQuery={calanderQuery}
- restoreEntry={callRestoreEntry}
+ calendarQuery={calenderQuery}
dispatchActionPromise={dispatchActionPromise}
+ restoreEntry={callRestoreEntry}
+ creator={creatorWithENSName}
/>
);
},

File Metadata

Mime Type
text/plain
Expires
Sun, Jan 18, 11:22 PM (10 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5953400
Default Alt Text
D6473.1768778529.diff (3 KB)

Event Timeline