()
| 325 | this.trace.push( |
| 326 | ...json.map((trace) => { |
| 327 | return {trace, time: new Date()}; |
| 328 | }), |
| 329 | ); |
| 330 | } |
| 331 | async queryBlog() { |
| 332 | //TODO remove this soon |
| 333 | if (true as false) return; |
| 334 | const prefs = getPreferences(); |
| 335 | const bstate = prefs.showBlogUpdates; |
| 336 | if (bstate === undefined) { |
| 337 | const pop = new Dialog(""); |
| 338 | pop.options.addText(I18n.blog.wantUpdates()); |
| 339 | const opts = pop.options.addOptions("", {ltr: true}); |
| 340 | opts.addButtonInput("", I18n.yes(), async () => { |
| 341 | prefs.showBlogUpdates = true; |
| 342 | await setPreferences(prefs); |
| 343 | this.queryBlog(); |
| 344 | pop.hide(); |
| 345 | }); |
| 346 | opts.addButtonInput("", I18n.no(), async () => { |
| 347 | prefs.showBlogUpdates = false; |
| 348 | await setPreferences(prefs); |
| 349 | this.queryBlog(); |
| 350 | pop.hide(); |
| 351 | }); |
| 352 | pop.show(); |
| 353 | } else if (bstate) { |
| 354 | const post = (await this.getPosts()).items[0]; |
| 355 | this.perminfo.localuser ??= {}; |
| 356 | if (this.perminfo.localuser.mostRecent !== post.url) { |
| 357 | this.perminfo.localuser.mostRecent = post.url; |
| 358 | const pop = new Dialog(post.title); |
| 359 | //TODO implement images for the rendering of this |
| 360 | pop.options.addText(post.content_html); |
| 361 | pop.options.addButtonInput("", I18n.blog.gotoPost(), () => { |
| 362 | window.open(post.url); |
| 363 | pop.hide(); |
| 364 | }); |
| 365 | pop.show(); |
no test coverage detected