Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplication and cropped hovercard in user-local-time #4384

Merged
merged 8 commits into from
Jun 3, 2021
4 changes: 2 additions & 2 deletions source/features/user-local-time.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ function parseOffset(date: string): number {
function init(): void {
const hovercard = select('.js-hovercard-content > .Popover-message')!;

observeElement(hovercard, async () => {
observeElement(hovercard, async ([mutation]) => {
if (
select.exists('.rgh-local-user-time', hovercard) || // Time already added
cheap-glitch marked this conversation as resolved.
Show resolved Hide resolved
mutation?.addedNodes?.length !== 1 || // Avoid duplicated time element issue #3634
fregante marked this conversation as resolved.
Show resolved Hide resolved
!select.exists('[data-hydro-view*="user-hovercard-hover"]', hovercard) // It's not the hovercard type we expect
) {
return;
Expand Down