Skip to content

Commit

Permalink
fix: Linting error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Anush008 committed Apr 27, 2023
1 parent c175343 commit bcd1f47
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/utils/dom-utils/inviteToOpenSauced.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const injectOpenSaucedInviteButton = (username: string) => {

const userBio = document.querySelector(GITHUB_PROFILE_MENU_SELECTOR);

if (!userBio || !userBio.parentNode) {
if (!(userBio?.parentNode)) {
return;
}
userBio.parentNode.replaceChild(inviteToOpenSaucedButton, userBio);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/dom-utils/viewOnOpenSauced.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const injectViewOnOpenSaucedButton = (username: string) => {
`${GITHUB_PROFILE_MENU_SELECTOR}, ${GITHUB_PROFILE_EDIT_MENU_SELECTOR}`,
);

if (!userBio || !userBio.parentNode) {
if (!(userBio?.parentNode)) {
return;
}
userBio.parentNode.replaceChild(viewOnOpenSaucedButton, userBio);
Expand Down
12 changes: 6 additions & 6 deletions src/utils/fetchOpenSaucedApiData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@ export const checkTokenValidity = async (token: string) => {
};

export const getUserData = async (userName: string, forceRefresh: boolean = false) => cachedFetch(`${OPEN_SAUCED_USERS_ENDPOINT}/${userName}`, {
expireInSeconds: 2 * 60 * 60, // 2 hours
expireInSeconds: 2 * 60 * 60,
forceRefresh,
headers: { Accept: "application/json" },
}).then(async resp => {
if (!resp.ok) {
if (!resp?.ok) {
console.log("error getting user info");
}
return resp.json();
return resp?.json();
})
.then(json => json);

export const getUserPRData = async (userName: string, forceRefresh: boolean = false) => cachedFetch(`${OPEN_SAUCED_USERS_ENDPOINT}/${userName}/prs`, {
expireInSeconds: 2 * 60 * 60, // 2 hours
expireInSeconds: 2 * 60 * 60,
forceRefresh,
headers: { Accept: "application/json" },
}).then(async resp => {
if (!resp.ok) {
if (!resp?.ok) {
console.log("error getting user PR info");
}
return resp.json();
return resp?.json();
})
.then(json => json);

0 comments on commit bcd1f47

Please sign in to comment.