Skip to content

Commit 26451b7

Browse files
committed
Upped dependencies
1 parent 3aef135 commit 26451b7

6 files changed

Lines changed: 2611 additions & 2621 deletions

File tree

client/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@surfnet/sds": "^0.0.130",
7-
"dompurify": "^3.2.5",
6+
"@surfnet/sds": "^0.0.137",
7+
"dompurify": "^3.2.6",
88
"i18n-js": "^4.5.1",
9-
"isomorphic-dompurify": "^2.24.0",
9+
"isomorphic-dompurify": "^2.25.0",
1010
"js-cookie": "^3.0.5",
1111
"lodash.debounce": "^4.0.8",
1212
"luxon": "^3.6.1",
1313
"react": "^19.1.0",
1414
"react-copy-to-clipboard": "^5.1.0",
15-
"react-datepicker": "8.3.0",
15+
"react-datepicker": "8.4.0",
1616
"react-dom": "^19.1.0",
17-
"react-router": "^7.5.3",
18-
"react-router-dom": "^7.5.3",
17+
"react-router": "^7.6.2",
18+
"react-router-dom": "^7.6.2",
1919
"react-select": "^5.10.1",
2020
"react-tooltip": "^5.28.1",
2121
"timeago.js": "^4.0.2",
2222
"tough-cookie": "^5.1.2",
2323
"word-wrap": "^1.2.5",
24-
"zustand": "^5.0.3"
24+
"zustand": "^5.0.5"
2525
},
2626
"devDependencies": {
2727
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
@@ -32,11 +32,11 @@
3232
"nth-check": "^2.1.1",
3333
"react-json-view-lite": "^2.4.1",
3434
"react-scripts": "5.0.1",
35-
"sass": "^1.87.0"
35+
"sass": "^1.89.1"
3636
},
3737
"resolutions": {
3838
"nth-check": "^2.1.1",
39-
"tough-cookie": "^4.1.4",
39+
"tough-cookie": "^5.1.2",
4040
"word-wrap": "^1.2.3"
4141
},
4242
"scripts": {

client/src/pages/App.js

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ import {MissingAttributes} from "./MissingAttributes";
2525
import {Inviter} from "./Inviter";
2626
import {Application} from "./Application";
2727
import {System} from "./System";
28+
import {flushSync} from "react-dom";
2829

2930

3031
export const App = () => {
3132

3233
const [loading, setLoading] = useState(true);
3334
const navigate = useNavigate();
34-
const {impersonator, authenticated, reload} = useAppStore(state => state);
35-
const {user} = useAppStore(state => state);
35+
const {user, impersonator, authenticated, reload} = useAppStore(state => state);
3636

3737
useEffect(() => {
3838
setLoading(true);
@@ -41,47 +41,54 @@ export const App = () => {
4141
configuration()
4242
.then(res => {
4343
useAppStore.setState(() => ({config: res}));
44+
let route;
45+
4446
if (!res.authenticated) {
4547
if (!res.name) {
4648
const direction = window.location.pathname + window.location.search;
4749
localStorage.setItem("location", direction);
48-
} else if (!isEmpty(res.missingAttributes)) {
49-
setLoading(false);
50-
navigate("/missingAttributes");
51-
return;
5250
}
53-
const pathname = localStorage.getItem("location") || window.location.pathname;
54-
const isInvitationAcceptFlow = window.location.pathname.startsWith("/invitation/accept")
55-
|| pathname.startsWith("/invitation/accept");
56-
let route = null;
57-
if (res.name && !pathname.startsWith("/invitation/accept") && !isInvitationAcceptFlow) {
58-
route = "/deadend"
59-
} else if (pathname === "/" || pathname.startsWith("/login") || pathname.startsWith("/invitation/accept") || isInvitationAcceptFlow) {
60-
setLoading(false);
61-
route = isInvitationAcceptFlow ? pathname : window.location.pathname + window.location.search;
51+
if (!isEmpty(res.missingAttributes)) {
52+
route = "/missingAttributes"
6253
} else {
63-
//Bookmarked URL's trigger a direct login and skip the landing page
64-
login(res);
54+
const pathname = localStorage.getItem("location") || window.location.pathname;
55+
const isInvitationAcceptFlow = window.location.pathname.startsWith("/invitation/accept")
56+
|| pathname.startsWith("/invitation/accept");
57+
if (res.name && !isInvitationAcceptFlow) {
58+
route = "/deadend"
59+
} else if (pathname === "/" || pathname.startsWith("/login") || pathname.startsWith("/invitation/accept") || isInvitationAcceptFlow) {
60+
route = isInvitationAcceptFlow ? pathname : window.location.pathname + window.location.search;
61+
}
6562
}
6663
if (!isEmpty(route)) {
67-
setLoading(false);
68-
setTimeout(() => navigate(route), 50);
64+
flushSync(() => {
65+
navigate(route, {replace: true})
66+
});
67+
} else {
68+
//Bookmarked URL's trigger a direct login and skip the landing page
69+
login(res);
6970
}
71+
setTimeout(() => setLoading(false), 500);
7072
} else {
7173
me()
7274
.then(res => {
7375
useAppStore.setState(() => ({user: res, authenticated: true}));
74-
setLoading(false);
7576
const location = localStorage.getItem("location") || window.location.pathname + window.location.search;
7677
const newLocation = location.startsWith("/login") ? "/home" : location;
7778
localStorage.removeItem("location");
78-
navigate(newLocation);
79+
debugger;
80+
flushSync(() => {
81+
navigate(newLocation, {replace: true})
82+
});
83+
setTimeout(() => setLoading(false), 500);
7984
});
8085
}
8186
})
8287
.catch(() => {
83-
setLoading(false);
84-
navigate("/deadend");
88+
flushSync(() => {
89+
navigate("/deadend", {replace: true})
90+
});
91+
setTimeout(() => setLoading(false), 500);
8592
})
8693
})
8794
}, [reload, impersonator]); // eslint-disable-line react-hooks/exhaustive-deps

0 commit comments

Comments
 (0)