(key?: string)
| 196 | // matches — a stale/late clear must not wipe a NEWER notice. Always drop |
| 197 | // a matching pending notice so it can't resurface at the next turn end. |
| 198 | clearNotice(key?: string) { |
| 199 | if (this.pendingNotice && this.pendingNotice.key === key) { |
| 200 | this.pendingNotice = null |
| 201 | } |
| 202 | |
| 203 | if (getUiState().notice?.key === key) { |
| 204 | this.clearNoticeTimer() |
| 205 | patchUiState({ notice: null }) |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | // Apply a notice to the visible UI state and (re)arm its TTL clock. |
| 210 | // Latest-wins: clear any prior TTL timer FIRST so an older notice's |
no test coverage detected