Keeps the chat composer's unsent message when the chat modal closes or the tab reloads. It lives in sessionStorage, per user; ChatModal reads it on open and writes it on every change.

Functions

f
readDraft(userId: string | undefined): StoredDraft

Returns the stored draft of userId, or an empty one when there is none, userId is undefined, or storage is blocked.

f
writeDraft(
userId: string | undefined,
value: StoredDraft
): void

Stores value as the draft of userId, or removes it when it has neither text nor a reply target. Does nothing when userId is undefined.

Interfaces

I