Skip to content

Commit

Permalink
[web] Disable thick thread entries from showing up in the history mod…
Browse files Browse the repository at this point in the history
…al as history entries

Summary:
This disables thick thread entries from showing up in the history modal

Depends on D13350

Test Plan: Tested on local webapp. Keyserver history entries still showed up fine but thick thread entries did not

Reviewers: ashoat, tomek, marcin

Reviewed By: ashoat

Differential Revision: https://phab.comm.dev/D13354
  • Loading branch information
wyilio committed Sep 16, 2024
1 parent 264bde5 commit 6348d73
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion web/modals/history/history-modal.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import type {
HistoryRevisionInfo,
} from 'lib/types/history-types.js';
import type { LoadingStatus } from 'lib/types/loading-types.js';
import type { RawThreadInfos } from 'lib/types/thread-types.js';
import { prettyDateWithoutDay } from 'lib/utils/date-utils.js';
import {
useDispatchActionPromise,
Expand All @@ -52,6 +53,7 @@ type BaseProps = {
type Props = {
...BaseProps,
+entryInfos: ?(EntryInfo[]),
+threadInfos: ?RawThreadInfos,
+dayLoadingStatus: LoadingStatus,
+entryLoadingStatus: LoadingStatus,
+calendarFilters: $ReadOnlyArray<CalendarFilter>,
Expand Down Expand Up @@ -112,9 +114,13 @@ class HistoryModal extends React.PureComponent<Props, State> {

let entries;
const entryInfos = this.props.entryInfos;
const threadInfos = this.props.threadInfos;
if (entryInfos) {
entries = _flow(
_filter((entryInfo: EntryInfo) => entryInfo.id),
_filter(
(entryInfo: EntryInfo) =>
entryInfo.id && !threadInfos?.[entryInfo.threadID].thick,
),
_map((entryInfo: EntryInfo) => {
const serverID = entryInfo.id;
invariant(serverID, 'serverID should be set');
Expand Down Expand Up @@ -259,6 +265,7 @@ const ConnectedHistoryModal: React.ComponentType<BaseProps> =
const entryInfos = useSelector(
state => allDaysToEntries(state)[props.dayString],
);
const threadInfos = useSelector(state => state.threadStore.threadInfos);
const dayLoadingStatus = useSelector(dayLoadingStatusSelector);
const entryLoadingStatus = useSelector(entryLoadingStatusSelector);
const calendarFilters = useSelector(
Expand All @@ -273,6 +280,7 @@ const ConnectedHistoryModal: React.ComponentType<BaseProps> =
<HistoryModal
{...props}
entryInfos={entryInfos}
threadInfos={threadInfos}
dayLoadingStatus={dayLoadingStatus}
entryLoadingStatus={entryLoadingStatus}
calendarFilters={calendarFilters}
Expand Down

0 comments on commit 6348d73

Please sign in to comment.