()
| 110 | } |
| 111 | |
| 112 | function scheduleDraftPersistence(): void { |
| 113 | if (typeof window === "undefined") return |
| 114 | if (idlePersistHandle != null) return |
| 115 | |
| 116 | ensurePersistenceListeners() |
| 117 | if ("requestIdleCallback" in window) { |
| 118 | idlePersistHandle = window.requestIdleCallback(() => { |
| 119 | flushPendingDraftPersistence() |
| 120 | }) |
| 121 | return |
| 122 | } |
| 123 | |
| 124 | // Fallback for runtimes without requestIdleCallback. |
| 125 | flushPendingDraftPersistence() |
| 126 | } |
| 127 | |
| 128 | export function buildConversationDraftStorageKey( |
| 129 | conversationId: number |
no test coverage detected