From e3b4f898d0312f972d62efd55bf17cd550d7ced6 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Sun, 2 Jun 2019 18:15:24 +0200 Subject: [PATCH] show eventkey in ui for debugging purposes --- src/domain/session/room/timeline/tiles/SimpleTile.js | 4 ++++ src/ui/web/TimelineTile.js | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/domain/session/room/timeline/tiles/SimpleTile.js b/src/domain/session/room/timeline/tiles/SimpleTile.js index 266b09db..605fc1c1 100644 --- a/src/domain/session/room/timeline/tiles/SimpleTile.js +++ b/src/domain/session/room/timeline/tiles/SimpleTile.js @@ -58,4 +58,8 @@ export default class SimpleTile { updateNextSibling(next) { } + + get internalId() { + return this._entry.asEventKey().toString(); + } } diff --git a/src/ui/web/TimelineTile.js b/src/ui/web/TimelineTile.js index bf03d5f4..4c0ff45d 100644 --- a/src/ui/web/TimelineTile.js +++ b/src/ui/web/TimelineTile.js @@ -23,7 +23,7 @@ export default class TimelineTile { function renderTile(tile) { switch (tile.shape) { case "message": - return html.li(null, tile.label); + return html.li(null, [html.strong(null, tile.internalId+" "), tile.label]); case "gap": { const button = html.button(null, (tile.isUp ? "🠝" : "🠟") + " fill gap"); const handler = () => { @@ -31,11 +31,11 @@ function renderTile(tile) { button.removeEventListener("click", handler); }; button.addEventListener("click", handler); - return html.li(null, button); + return html.li(null, [html.strong(null, tile.internalId+" "), button]); } case "announcement": - return html.li(null, tile.label); + return html.li(null, [html.strong(null, tile.internalId+" "), tile.label]); default: - return html.li(null, "unknown tile shape: " + tile.shape); + return html.li(null, [html.strong(null, tile.internalId+" "), "unknown tile shape: " + tile.shape]); } }