MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / applyNotice

Method applyNotice

ui-tui/src/app/turnController.ts:213–231  ·  view source on GitHub ↗
(notice: Notice)

Source from the content-addressed store, hash-verified

211 // expiry can't wipe this one. A 'ttl' notice with `ttl_ms` self-expires;
212 // 'sticky' (default) persists until an explicit clear.
213 private applyNotice(notice: Notice) {
214 this.clearNoticeTimer()
215 patchUiState({ notice })
216
217 if (notice.kind === 'ttl' && typeof notice.ttl_ms === 'number' && notice.ttl_ms > 0) {
218 const id = notice.id
219
220 this.noticeTimer = setTimeout(() => {
221 this.noticeTimer = null
222
223 // Defensive backup: the prior timer was already cancelled by
224 // clearNoticeTimer() when a newer notice was applied, so in
225 // practice this guard only fires for the notice that armed it.
226 if (getUiState().notice?.id === id) {
227 patchUiState({ notice: null })
228 }
229 }, notice.ttl_ms)
230 }
231 }
232
233 private clearNoticeTimer() {
234 this.noticeTimer = clear(this.noticeTimer)

Callers 2

showNoticeMethod · 0.95
flushPendingNoticeMethod · 0.95

Calls 3

clearNoticeTimerMethod · 0.95
patchUiStateFunction · 0.85
getUiStateFunction · 0.85

Tested by

no test coverage detected