Skip to content
This repository was archived by the owner on Aug 2, 2025. It is now read-only.

Commit 0c9dee8

Browse files
committed
chore: update
1 parent 78dc6d7 commit 0c9dee8

File tree

6 files changed

+265
-108
lines changed

6 files changed

+265
-108
lines changed

apps/client/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
"@rollup/plugin-replace": "^4.0.0",
3030
"@sentry/react": "^7.76.0",
3131
"@sentry/vite-plugin": "^2.9.0",
32-
"@tanstack/query-sync-storage-persister": "^4.0.10",
33-
"@tanstack/react-query": "^4.20.4",
34-
"@tanstack/react-query-devtools": "^4.0.10",
35-
"@tanstack/react-query-persist-client": "^4.0.10",
32+
"@tanstack/query-sync-storage-persister": "^5.17.19",
33+
"@tanstack/react-query": "^5.17.19",
34+
"@tanstack/react-query-devtools": "^5.17.19",
35+
"@tanstack/react-query-persist-client": "^5.17.19",
3636
"@types/react-dom": "^18.0.9",
3737
"@vercel/analytics": "^1.1.1",
3838
"dayzed": "^3.2.3",
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
1+
import { DateTime } from "luxon";
2+
3+
// A data provider provides a queryFn and a select function. The result of
4+
// queryFn should be serializable and deserializable with JSON.stringify. THis
5+
// means types like Date will not work, as they will be serialised to a string
6+
// but not deserialised back to a Date.
7+
8+
type LongOrShortString = {
9+
short: string;
10+
long?: string;
11+
};
12+
13+
type Period = {
14+
start: DateTime;
15+
end: DateTime;
16+
teacher?: LongOrShortString;
17+
name?: LongOrShortString;
18+
location?: LongOrShortString;
19+
};
20+
121
export interface DataProvider {
222
activate(): void;
323
deactivate(): void;
424
isActivated(): boolean;
25+
26+
// Returns a scan-on barcode if applicable
27+
barcode?(): Promise<string>;
528
}

apps/client/src/main.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,10 @@ const toast = new Toast();
4545
const queryClient = new QueryClient({
4646
defaultOptions: {
4747
queries: {
48-
cacheTime: Infinity,
48+
gcTime: Infinity,
4949
refetchInterval: 5 * 60 * 1000, // 5 minutes
5050
refetchIntervalInBackground: true,
5151
networkMode: "always",
52-
useErrorBoundary: (error, query) =>
53-
!(error instanceof UnauthorizedError) &&
54-
!(error instanceof NetworkError) &&
55-
!query.state.data,
5652
},
5753
},
5854
queryCache: new QueryCache({
@@ -78,9 +74,8 @@ const persister = createSyncStoragePersister({
7874
});
7975

8076
const oauthClient = new OAuth2Client({
81-
server: "https://student.sbhs.net.au",
77+
server: "https://auth.sbhs.net.au/",
8278
clientId: config.client_id,
83-
tokenEndpoint: "/api/token",
8479
authorizationEndpoint: config.authorization_endpoint,
8580
});
8681

@@ -134,7 +129,14 @@ const userInterface = new UserInterface(
134129
// =======
135130

136131
// Initialise analytics
137-
inject();
132+
inject({
133+
beforeSend: (event) => {
134+
if (event.type === "pageview") {
135+
event.url = event.url.split("?")[0] ?? event.url;
136+
}
137+
return event;
138+
},
139+
});
138140

139141
authActions.resolve();
140142

apps/client/src/routes/Landing/Hero/Hero.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const Hero = () => {
4747
initial={"hidden"}
4848
animate={"visible"}
4949
>
50-
Your school life, organised
50+
Never be late again
5151
</Heading>
5252
<Text fontSize={"xl"} color="gray.500">
5353
Timetabl is a fast and reliable timetable app for Sydney Boys High

apps/client/src/services/OAuth2Actions/OAuth2Actions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ class OAuth2Actions implements AuthActions {
6565
new URLSearchParams(window.location.search).entries()
6666
);
6767

68+
if (localStorage.getItem("debug") === "true") {
69+
console.table(query);
70+
}
71+
6872
// Error check
6973
if (query.error) {
7074
this.toast.notify({

0 commit comments

Comments
 (0)