@@ -5,10 +5,7 @@ import ActivityItem from "./../ActivityItem";
55import MuiAlert from "@material-ui/lab/Alert" ;
66import { Snackbar } from "@material-ui/core" ;
77import ConfigureWebhook from "../ConfigureWebhook" ;
8- import {
9- githubPrivateRepoAccessClientID ,
10- githubApiDomain ,
11- } from "../../utils/constants" ;
8+ import { githubApiDomain } from "../../utils/constants" ;
129import { IoSettingsOutline } from "react-icons/io5" ;
1310
1411import "./index.css" ;
@@ -81,14 +78,12 @@ export default function ActivityPane(props) {
8178 const repository = props . location . pathname
8279 . split ( "/" ) [ 2 ]
8380 . replace ( "_" , "/" ) ;
84- const authToken =
85- Cookies . get ( "gh_private_repo_token" ) ||
86- Cookies . get ( "gh_login_token" ) ;
81+ const authToken = Cookies . get ( "gh_login_token" ) ;
8782 const ghRepoResponse = await axios ( {
8883 method : "get" ,
8984 url : `${ githubApiDomain } /repos/${ repository } ` ,
9085 headers : {
91- accept : "application/json" ,
86+ accept : "application/vnd.github.v3+ json" ,
9287 Authorization : `token ${ authToken } ` ,
9388 } ,
9489 } ) ;
@@ -119,15 +114,6 @@ export default function ActivityPane(props) {
119114 }
120115 } , [ webhookId ] ) ;
121116
122- const handleClickConfigureWebhooks = async ( ) => {
123- if ( ! Cookies . get ( "gh_private_repo_token" ) ) {
124- Cookies . set ( "gh_upgrade_prev_path" , window . location . pathname ) ;
125- window . location . href = `https://github.com/login/oauth/authorize?scope=repo&client_id=${ githubPrivateRepoAccessClientID } ` ;
126- } else {
127- setOpenWebhookDialog ( true ) ;
128- }
129- } ;
130-
131117 const setSnackbar = ( snackbarSeverity , snackbarText ) => {
132118 setSnackbarSeverity ( snackbarSeverity ) ;
133119 setSnackbarText ( snackbarText ) ;
@@ -151,7 +137,7 @@ export default function ActivityPane(props) {
151137 < div className = "configure-webhooks-control" >
152138 < IoSettingsOutline
153139 className = "configure-webhooks-icon"
154- onClick = { handleClickConfigureWebhooks }
140+ onClick = { ( ) => setOpenWebhookDialog ( true ) }
155141 />
156142 </ div >
157143 ) }
@@ -165,10 +151,10 @@ export default function ActivityPane(props) {
165151 </ div >
166152 ) }
167153 { webhookId &&
168- events . map ( ( event ) => {
154+ events . map ( ( event , index ) => {
169155 return (
170156 < ActivityItem
171- key = { event . _id }
157+ key = { index }
172158 event = { event }
173159 repo = { props . location . pathname . split ( "/" ) [ 2 ] . replace ( "_" , "/" ) }
174160 />
0 commit comments