summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Roman Pavlov <rspaulau@gmail.com> 2019-12-01 21:55:32 -0800
committerGravatar Federico Brigante <github@bfred.it> 2019-12-02 12:55:32 +0700
commite9e014747f7ac52c09b6a93da284f0e4d55ca4e7 (patch)
tree2c4349c7c4c64ca1728d7104b6695f81238034fa
parent7cf8cee943cc3d10167dd2014bd1fafde356996a (diff)
downloadrefined-github-e9e014747f7ac52c09b6a93da284f0e4d55ca4e7.tar.gz
refined-github-e9e014747f7ac52c09b6a93da284f0e4d55ca4e7.tar.zst
refined-github-e9e014747f7ac52c09b6a93da284f0e4d55ca4e7.zip
Disable `linkify-user-location` on own editable profile (#2584)
-rw-r--r--source/features/linkify-user-location.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/features/linkify-user-location.tsx b/source/features/linkify-user-location.tsx
index 947819f2..214c636e 100644
--- a/source/features/linkify-user-location.tsx
+++ b/source/features/linkify-user-location.tsx
@@ -1,11 +1,15 @@
import React from 'dom-chef';
import select from 'select-dom';
-import {wrap} from '../libs/dom-utils';
+import {wrap, isEditable} from '../libs/dom-utils';
import features from '../libs/features';
function addLocation(baseElement: HTMLElement): void {
for (const {nextElementSibling, nextSibling} of select.all('.octicon-location', baseElement)) {
const location = nextElementSibling || nextSibling!; // `nextSibling` alone might point to an empty TextNode before an element, if there’s an element
+ if (isEditable(location)) {
+ continue;
+ }
+
const locationName = location.textContent!.trim();
const googleMapsLink = `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(locationName)}`;