Skip to content

Commit

Permalink
Fix double IP display, fix copy to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
karaok491 committed Nov 5, 2020
1 parent 0a27550 commit 4b68a00
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 = [(
<span oncreate={vnode => $(vnode.dom).tooltip()} title={description + (!!threat ? ` (${threat})` : '')} onclick={ipAddress && copyIP(ipAddress)}>
{el.text}
{ipAddress}
</span>
)];

Expand Down

0 comments on commit 4b68a00

Please sign in to comment.