Skip to content

Commit

Permalink
chore: updated injector functions for empty bio
Browse files Browse the repository at this point in the history
  • Loading branch information
Anush008 committed Apr 20, 2023
1 parent c96682a commit e792985
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/utils/dom-utils/inviteToOpenSauced.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ const injectViewOnOS = (username: string) => {
inviteToOpenSaucedModal.style.display = "block";
};

const userBio = document.querySelector(".p-note.user-profile-bio");
if (!userBio) return;

userBio.appendChild(inviteToOpenSaucedButton);
const userBio = document.querySelector(".p-nickname.vcard-username.d-block");
if (!userBio || userBio.parentNode == null) return;
userBio.parentNode.replaceChild(inviteToOpenSaucedButton, userBio);
document.body.appendChild(inviteToOpenSaucedModal);
};

Expand Down
9 changes: 5 additions & 4 deletions src/utils/dom-utils/viewOnOpenSauced.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import { ViewOnOpenSaucedButton } from "../../components/ViewOnOpenSaucedButton/
const injectViewOnOpenSauced = (username: string) => {
const viewOnOpenSaucedButton = ViewOnOpenSaucedButton(username);

const userBio = document.querySelector(".p-note.user-profile-bio");
if (!userBio) return;

userBio.appendChild(viewOnOpenSaucedButton);
const userBio = document.querySelector(
".p-nickname.vcard-username.d-block, button.js-profile-editable-edit-button"
);
if (!userBio || userBio.parentNode == null) return;
userBio.parentNode.replaceChild(viewOnOpenSaucedButton, userBio);
};

export default injectViewOnOpenSauced;

0 comments on commit e792985

Please sign in to comment.