MCPcopy Create free account
hub / github.com/CommE2E/comm / setDraft

Method setDraft

web/input/input-state-container.react.js:1482–1493  ·  view source on GitHub ↗
(threadID: ?string, draft: string)

Source from the content-addressed store, hash-verified

1480 }
1481
1482 setDraft(threadID: ?string, draft: string) {
1483 invariant(threadID, 'threadID should be set in setDraft');
1484
1485 const newThreadID = this.getRealizedOrPendingThreadID(threadID);
1486 this.props.dispatch({
1487 type: 'UPDATE_DRAFT',
1488 payload: {
1489 key: draftKeyFromThreadID(newThreadID),
1490 text: draft,
1491 },
1492 });
1493 }
1494
1495 setTextCursorPosition(threadID: ?string, newPosition: number) {
1496 invariant(threadID, 'threadID should be set in setTextCursorPosition');

Callers 3

InputStateContainerClass · 0.95
ChatInputBarClass · 0.80

Calls 2

draftKeyFromThreadIDFunction · 0.90

Tested by

no test coverage detected