Skip to content
Snippets Groups Projects

Notifications + small updates

Merged H9031 requested to merge notification-view into development
1 file
+ 22
20
Compare changes
  • Side-by-side
  • Inline
+ 22
20
@@ -67,27 +67,29 @@ export default class GameView extends React.Component {
@@ -67,27 +67,29 @@ export default class GameView extends React.Component {
}
}
handleLeaveFaction = e => {
handleLeaveFaction = e => {
let token = sessionStorage.getItem("token");
if (window.confirm("Are you sure you want to leave your faction?")) {
fetch(
let token = sessionStorage.getItem("token");
`${process.env.REACT_APP_API_URL}/faction/leave/${
fetch(
this.state.gameInfo.id
`${process.env.REACT_APP_API_URL}/faction/leave/${
}`,
this.state.gameInfo.id
{
}`,
method: "DELETE",
{
headers: {
method: "DELETE",
Authorization: "Bearer " + token
headers: {
}
Authorization: "Bearer " + token
}
}
)
.then(res => {
if (!res.ok) {
}
}
return res.json();
)
})
.then(res => {
.then(res => {
if (!res.ok) {
alert(res.message);
}
})
return res.json();
.catch(error => console.log(error));
})
 
.then(res => {
 
alert(res.message);
 
})
 
.catch(error => console.log(error));
 
}
};
};
// setting the socket signal automatically fires shouldComponentUpdate function where socketSignal prop is present
// setting the socket signal automatically fires shouldComponentUpdate function where socketSignal prop is present
Loading