From 4b68a005d6b550fb72fb811560feb420bd145d0a Mon Sep 17 00:00:00 2001 From: karaok Date: Thu, 5 Nov 2020 14:56:35 +0000 Subject: [PATCH] Fix double IP display, fix copy to clipboard --- js/src/forum/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/src/forum/index.js b/js/src/forum/index.js index b5877b8..a64f770 100644 --- a/js/src/forum/index.js +++ b/js/src/forum/index.js @@ -40,7 +40,7 @@ app.initializers.add('fof/geoip', () => { if (!this.attrs.post) return; const ipInfo = this.attrs.post.ipInfo(); - const ipAddress = this.attrs.post.ipAddress && this.attrs.post.ipAddress(); + const ipAddress = this.attrs.post.data.attributes.ipAddress; if (!ipInfo) return; @@ -49,9 +49,12 @@ app.initializers.add('fof/geoip', () => { const { description, threat, image } = getIPData(ipInfo); + // Hack to prevent double IP address being displayed. + el.text = ' '; + el.children = [( $(vnode.dom).tooltip()} title={description + (!!threat ? ` (${threat})` : '')} onclick={ipAddress && copyIP(ipAddress)}> - {el.text} + {ipAddress} )];