@hlfan commented on this pull request.
> @@ -37,7 +37,8 @@ $(function () {
id.attr("src", idData.url + "#" + params);
id.ready(function () {
- if (!this.contentWindow.location.href.startsWith(idData.url)) {
+ id.focus();
+ if (this.contentWindow &&
!this.contentWindow.location.href.startsWith(idData.url)) {
When splitting it out, I'd check for valid chaining until the href instead of
just the content window.
```suggestion
const href = this?.contentWindow?.location?.href;
if (href && !href.startsWith(idData.url)) {
```
Otherwise this looks good to me.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6083#pullrequestreview-2892327616
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/6083/review/2892327...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev