Skip to content
This repository was archived by the owner on Oct 30, 2025. It is now read-only.
Merged
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
2 changes: 1 addition & 1 deletion client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>RC4Community</title>
<title>RCforCommunity</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
30 changes: 8 additions & 22 deletions client/src/components/ActivityPane/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import ActivityItem from "./../ActivityItem";
import MuiAlert from "@material-ui/lab/Alert";
import { Snackbar } from "@material-ui/core";
import ConfigureWebhook from "../ConfigureWebhook";
import {
githubPrivateRepoAccessClientID,
githubApiDomain,
} from "../../utils/constants";
import { githubApiDomain } from "../../utils/constants";
import { IoSettingsOutline } from "react-icons/io5";

import "./index.css";
Expand Down Expand Up @@ -81,14 +78,12 @@ export default function ActivityPane(props) {
const repository = props.location.pathname
.split("/")[2]
.replace("_", "/");
const authToken =
Cookies.get("gh_private_repo_token") ||
Cookies.get("gh_login_token");
const authToken = Cookies.get("gh_login_token");
const ghRepoResponse = await axios({
method: "get",
url: `${githubApiDomain}/repos/${repository}`,
headers: {
accept: "application/json",
accept: "application/vnd.github.v3+json",
Authorization: `token ${authToken}`,
},
});
Expand All @@ -98,7 +93,7 @@ export default function ActivityPane(props) {
} catch (error) {
console.log(error);
}
}
};
checkIfUserIsOwner();
// eslint-disable-next-line
}, [props.location.pathname]);
Expand All @@ -118,15 +113,6 @@ export default function ActivityPane(props) {
}
}, [webhookId]);

const handleClickConfigureWebhooks = async () => {
if (!Cookies.get("gh_private_repo_token")) {
Cookies.set("gh_upgrade_prev_path", window.location.pathname);
window.location.href = `https://github.com/login/oauth/authorize?scope=repo&client_id=${githubPrivateRepoAccessClientID}`;
} else {
setOpenWebhookDialog(true);
}
};

const setSnackbar = (snackbarSeverity, snackbarText) => {
setSnackbarSeverity(snackbarSeverity);
setSnackbarText(snackbarText);
Expand All @@ -143,14 +129,14 @@ export default function ActivityPane(props) {

return (
<div className="activity-pane-wrapper">
<hr className="activity-pane-divider"/>
<hr className="activity-pane-divider" />
<div className="activity-pane-header">
<span>Activity </span>
{authState.isLoggedIn && isRepoOwner && (
<div className="configure-webhooks-control">
<IoSettingsOutline
className="configure-webhooks-icon"
onClick={handleClickConfigureWebhooks}
onClick={() => setOpenWebhookDialog(true)}
/>
</div>
)}
Expand All @@ -164,10 +150,10 @@ export default function ActivityPane(props) {
</div>
)}
{webhookId &&
events.map((event) => {
events.map((event, index) => {
return (
<ActivityItem
key={event._id}
key={index}
event={event}
repo={props.location.pathname.split("/")[2].replace("_", "/")}
/>
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ export default class App extends React.Component {
stats: data.data
})
})
.catch((err) => {
console.log("Error logging out --->", err);
.catch((error) => {
console.log(error);
return;
});
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/ChatWindow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function ChatWindow(props) {
{ externalCommand: "go", path: `${pathname}/?layout=embedded` },
`${rcApiDomain}`
);
}, [pathname]);
}, [props.location]);
return (
<div
className={`chatWindow-container ${
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/ConfigureWebhook/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function ConfigureWebhook(props) {
props.setSnackbar("success", "Webhook created successfully!");
props.setOpenWebhookDialog(false);
} catch (error) {
console.log(error.response.data.errors);
console.log(error);
setLoading(false);
props.setSnackbar("error", error.response.data.errors[0].message);
}
Expand All @@ -82,7 +82,7 @@ export default function ConfigureWebhook(props) {
props.setSnackbar("success", "Webhook updated successfully!");
props.setOpenWebhookDialog(false);
} catch (error) {
console.log(error.response.data.errors);
console.log(error);
setLoading(false);
props.setSnackbar("error", error.response.data.errors[0].message);
}
Expand Down Expand Up @@ -110,7 +110,7 @@ export default function ConfigureWebhook(props) {
props.setSnackbar("success", "Webhook deleted successfully!");
props.setOpenWebhookDialog(false);
} catch (error) {
console.log(error.response.data.errors);
console.log(error);
setDeleteLoading(false);
props.setSnackbar("error", error.response.data.errors[0].message);
}
Expand Down
9 changes: 8 additions & 1 deletion client/src/components/CreateChannel/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,11 @@

.repository-select-label {
margin-top: 0px;
}
display: flex;
justify-content: space-between;
}

.install-github-app-link {
color: inherit;
text-decoration: underline;
}
Loading