Page MenuHomePhabricator

[web] [lib] Introduce `getMessagePreview` function
ClosedPublic

Authored by jacek on Apr 1 2022, 7:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 16 2024, 10:21 PM
Unknown Object (File)
Nov 10 2024, 1:03 AM
Unknown Object (File)
Nov 9 2024, 11:13 PM
Unknown Object (File)
Nov 9 2024, 9:16 PM
Unknown Object (File)
Nov 9 2024, 8:28 PM
Unknown Object (File)
Nov 9 2024, 8:28 PM
Unknown Object (File)
Nov 9 2024, 4:02 PM
Unknown Object (File)
Nov 6 2024, 3:34 PM

Details

Summary

Moved logic for displaying message preview data into common function, to reuse it in modal with subchannels list.
No logic changes has been made.

Test Plan

In web app, message previews in chat list should display exactly as before.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek requested changes to this revision.Apr 4 2022, 2:05 AM
tomek added inline comments.
lib/hooks/message-preview.js
7–12 ↗(On Diff #10956)

We can probably merge these

20 ↗(On Diff #10956)

We're not using hooks inside it, so maybe this can be a plain function instead of a hook?

25–27 ↗(On Diff #10956)

We could introduce a different return type that represents no messages and use this in message-preview instead of checking if (!originalMessageInfo) {. This value can probably be just null.

This revision now requires changes to proceed.Apr 4 2022, 2:05 AM

Changed the hook into plain function

jacek retitled this revision from [web] [lib] Introduce `useMessagePreview` hook to [web] [lib] Introduce `getMessagePreview` function.Apr 4 2022, 6:18 AM
jacek edited the summary of this revision. (Show Details)
tomek added inline comments.
lib/hooks/message-preview.js
25–27 ↗(On Diff #10956)

What do you think about this idea?

This revision is now accepted and ready to land.Apr 5 2022, 7:01 AM
lib/hooks/message-preview.js
25–27 ↗(On Diff #10956)

I think the idea is no longer valid, as after changing the hook into function, I execute it conditionally and message info is always present.