Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

Update dependencies #303

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"dependencies": {
"@discordjs/uws": "10.149.0",
"ammo.js": "kripken/ammo.js#ac08f42d3995cfa2b719aa8a9bb5b766c7f63404",
"better-sqlite3": "^6.0.1",
"better-sqlite3": "^7.4.3",
"body-parser": "^1.18.2",
"colors": "^1.2.1",
"compression": "^1.7.2",
Expand All @@ -44,16 +44,16 @@
"js-cookie": "^2.2.0",
"msgpack-lite": "^0.1.26",
"mustache-express": "^1.2.5",
"pako": "^1.0.10",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"pako": "^2.0.4",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"reconnecting-websocket": "^4.4.0",
"request": "^2.88.0",
"request-promise-native": "^1.0.7",
"semver": "^7.1.0",
"stats-js": "^1.0.0",
"styled-components": "^5.1.0",
"three": "^0.123.0",
"three": "^0.132.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like Three.js has breaking changes (which we get warnings about when building the client), causing the editor to break:
image

"uWebSockets.js": "uNetworking/uWebSockets.js#v17.3.0"
},
"optionalDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/client/chat/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ domReady.then(() => {
let chatMessageTemplate = document.getElementById("messageTemplate");

// Check for former authentication
cookieData = Cookies.getJSON("user_data");
cookieData = JSON.parse(Cookies.get("user_data"));
checkAuthentication();

let lastMessageSent = Date.now();
Expand Down Expand Up @@ -181,7 +181,7 @@ function authenticationWindow() {
window.addEventListener("message", receiveMessage, false);
function receiveMessage(event) {
if (event.data && event.data.success && event.origin === window.location.origin) {
cookieData = Cookies.getJSON("user_data");
cookieData = JSON.parse(Cookies.get("user_data"));
authWindow.close();
checkAuthentication();

Expand Down
2 changes: 1 addition & 1 deletion src/client/chat/discord-api-redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ domReady.then(() => {
let user_data = JSON.parse(response);

let days = (user_data.expires_in / 62400) - 0.1; // seconds to days minus some slack
Cookies.set("user_data", user_data, {
Cookies.set("user_data", response, {
expires: days,
path: "/",
domain: window.location.hostname,
Expand Down
6 changes: 3 additions & 3 deletions src/client/user-state.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import * as Cookies from "js-cookie";
import Cookies from "js-cookie";

window.addEventListener("message", function(event) {
// Don't parse anything that isn't ours
if (event.origin !== window.location.origin) return;

// If the authorization state has changed, update the user data
if (event.data === userState.AUTH_CHANGED) {
userState.data = Cookies.getJSON("user_data");
userState.data = JSON.parse(Cookies.get("user_data"));
}
}, false);

let userState = {
AUTH_CHANGED: 0,

data: Cookies.getJSON("user_data")
data: JSON.parse(Cookies.get("user_data"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
When I logged out on the client page and refreshed, the page failed to load fully and got this in my console.

};

export { userState };
Loading