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

Os fixes #1754

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const getPaperUrl = (caseData: any) => {
if (caseData?.paper) {
return `/paper/${caseData?.paper?.id}/${caseData?.paper?.slug}`;
} else {
if (caseData?.targetPaperDOI.indexOf("doi.org") > -1) {
if (caseData?.targetPaperDOI?.indexOf("doi.org") > -1) {
return caseData?.targetPaperDOI;
}
return "https://doi.org/" + caseData?.targetPaperDOI;
Expand All @@ -30,7 +30,6 @@ export default function AuthorClaimCaseCardTargetAuthorSection({
requestor,
}: Props): ReactElement<"div"> {
const paperUrl = getPaperUrl(caseData);
console.log("requestor", requestor);
return (
<div className={css(styles.targetAuthorSection)}>
<div className={css(styles.caseDetails)}>
Expand Down
1 change: 1 addition & 0 deletions components/Document/DocumentViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ const styles = StyleSheet.create({
position: "relative",
justifyContent: "center",
width: "100%",
zIndex: 2,
},
scroll: {
overflowX: "scroll",
Expand Down
2 changes: 2 additions & 0 deletions components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ const styles = StyleSheet.create({
signUpBtn: {
width: 90,
fontSize: 16,
marginRight: 16,
},
navbarContainer: {
alignItems: "center",
Expand All @@ -270,6 +271,7 @@ const styles = StyleSheet.create({
justifyContent: "space-between",
left: 0,
padding: "0 0px 0 28px",

position: "sticky",
top: 0,
width: "100%",
Expand Down
10 changes: 4 additions & 6 deletions components/Paper/Upload/styles/formGenericStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,20 @@ export const formGenericStyles = StyleSheet.create({
marginTop: 40,
overflowY: "scroll",
[`@media only screen and (max-width: ${breakpoints.medium.str})`]: {
width: 600,
padding: 32,
marginTop: 16,
},
[`@media only screen and (max-width: 767px)`]: {
width: "calc(100% - 16px)",
padding: 16,
boxSizing: 'border-box',
boxSizing: "border-box",
border: 0,
},
},
textArea: {
"@media only screen and (max-width: 767px)": {
marginTop: 16,
}
},
},
header: {
fontSize: 22,
Expand Down Expand Up @@ -193,9 +192,8 @@ export const formGenericStyles = StyleSheet.create({
},
container: {
marginBottom: 10,
width: 600,
"@media only screen and (max-width: 767px)": {
width: '100%',
width: "100%",
},
"@media only screen and (max-width: 415px)": {
width: 338,
Expand All @@ -210,7 +208,7 @@ export const formGenericStyles = StyleSheet.create({
marginBottom: 20,
width: 600,
"@media only screen and (max-width: 767px)": {
width: '100%',
width: "100%",
},
"@media only screen and (max-width: 415px)": {
width: 338,
Expand Down
2 changes: 1 addition & 1 deletion config/auth/ensureAuthenticated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async function ensureAuthenticated({
.then(Helpers.parseJSON);
} catch (error: any) {
const isAuthError =
error.response.status === 401 || error.response.status === 403;
error?.response?.status === 401 || error?.response?.status === 403;

if (isAuthError) {
return {
Expand Down
9 changes: 4 additions & 5 deletions pages/notebook/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,21 @@ export async function getServerSideProps(ctx) {
let orgsResponse: Response;
try {
orgsResponse = await fetchUserOrgs({ url }, authToken);
}
catch (error: any) {
} catch (error: any) {
if (error?.response?.status === 401) {
return {
redirect: {
destination: `/login?redirect=${ctx.req.url}`,
permanent: false,
},
};
}
else {
} else {
console.log(error);
return {
props: {
errorCode: 500,
},
}
};
}
}

Expand Down