Skip to content

A platform for community discussion. Free, open, simple.

FIX: don't look up IP if user doesn't exist, adjust whitespace (#36326)

Kris20d29a689369
diff --git a/app/assets/stylesheets/common/base/review.scss b/app/assets/stylesheets/common/base/review.scss
index f94f28c8852..d48aa3eebf3 100644
--- a/app/assets/stylesheets/common/base/review.scss
+++ b/app/assets/stylesheets/common/base/review.scss
@@ -431,6 +431,10 @@
font-size: var(--font-down-1);
color: var(--primary-high);
}
+
+ .reviewable-ip-lookup {
+ white-space: normal;
+ }
}
.review-item__moderator-actions {
diff --git a/frontend/discourse/app/components/reviewable-refresh/ip-lookup.gjs b/frontend/discourse/app/components/reviewable-refresh/ip-lookup.gjs
index ce2217f2ddf..37023e236dc 100644
--- a/frontend/discourse/app/components/reviewable-refresh/ip-lookup.gjs
+++ b/frontend/discourse/app/components/reviewable-refresh/ip-lookup.gjs
@@ -60,6 +60,11 @@ export default class ReviewableIpLookup extends Component {
@action
async loadIpData() {
+ if (!this.target) {
+ this.loading = false;
+ return;
+ }
+
try {
const userInfo = await AdminUser.find(this.target);
this.ipAddress = userInfo.ip_address;
@@ -163,9 +168,7 @@ export default class ReviewableIpLookup extends Component {
href="https://maps.google.com/maps?q={{this.location.latitude}},{{this.location.longitude}}"
rel="noopener noreferrer"
target="_blank"
- >
- {{this.location.location}}
- </a>
+ >{{this.location.location}}</a>
{{else}}
{{i18n "ip_lookup.location_not_found"}}
{{/if}}