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

Method setDraft

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

Source from the content-addressed store, hash-verified

1497 }
1498
1499 setDraft(threadID: ?string, draft: string) {
1500 invariant(threadID, 'threadID should be set in setDraft');
1501
1502 const newThreadID = this.getRealizedOrPendingThreadID(threadID);
1503 this.props.dispatch({
1504 type: 'UPDATE_DRAFT',
1505 payload: {
1506 key: draftKeyFromThreadID(newThreadID),
1507 text: draft,
1508 },
1509 });
1510 }
1511
1512 setTextCursorPosition(threadID: ?string, newPosition: number) {
1513 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