diff options
author | 2019-12-01 21:55:32 -0800 | |
---|---|---|
committer | 2019-12-02 12:55:32 +0700 | |
commit | e9e014747f7ac52c09b6a93da284f0e4d55ca4e7 (patch) | |
tree | 2c4349c7c4c64ca1728d7104b6695f81238034fa | |
parent | 7cf8cee943cc3d10167dd2014bd1fafde356996a (diff) | |
download | refined-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.tsx | 6 |
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)}`; |