MCPcopy
hub / github.com/witheve/Eve / injectNotice

Method injectNotice

src/ide.ts:2388–2405  ·  view source on GitHub ↗
(type:string, message:string|ElemGen)

Source from the content-addressed store, hash-verified

2386 }
2387
2388 injectNotice(type:string, message:string|ElemGen) {
2389 let time = Date.now();
2390 let existing;
2391 for(let notice of this.notices) {
2392 if(notice.type === type && notice.message === message) {
2393 existing = notice;
2394 existing.time = time;
2395 break;
2396 }
2397 }
2398 if(!existing) {
2399 existing = {type, message, time};
2400 this.notices.push(existing);
2401 }
2402 this.render();
2403 this.editor.cm.refresh();
2404 return existing;
2405 }
2406
2407 dismissNotice(notice) {
2408 let ix = this.notices.indexOf(notice);

Callers 2

saveToGistMethod · 0.95
loadFromGistMethod · 0.95

Calls 2

renderMethod · 0.95
refreshMethod · 0.65

Tested by

no test coverage detected