Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function CompletedQuestionsPercentage() {

return (
<>
{solvedQuestions}/{totalQuestions} ({completedPercentage.toFixed(2)}%)
{solvedQuestions}/{totalQuestions} ({completedPercentage.toFixed(0)}%)
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function ResolvedQuestions() {
const { data } = useSuspenseQuery(RESOLVED_QUESTIONS);
const totalQuestions = data.me.submissionStatistics.totalQuestions;
const solvedQuestions = data.me.submissionStatistics.solvedQuestions;
const resolvedQuestions = solvedQuestions / totalQuestions;
const resolvedQuestions = solvedQuestions / totalQuestions * 100;

return (
<div className="flex flex-col gap-1">
Expand Down
5 changes: 4 additions & 1 deletion lib/apollo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { HttpLink } from "@apollo/client";
import { ApolloClient, InMemoryCache } from "@apollo/client-integration-nextjs";
import { PersistedQueryLink } from "@apollo/client/link/persisted-queries";
import { sha256 } from "crypto-hash";
import buildUri from "./build-uri";

/**
Expand All @@ -8,6 +10,7 @@ import buildUri from "./build-uri";
* You should add the token to the headers of the request.
*/
export function makeClient({ token }: { token?: string | null }) {
const persistedQueryLink = new PersistedQueryLink({ sha256 });
const httpLink = new HttpLink({
uri: buildUri("/query"),
headers: {
Expand All @@ -17,6 +20,6 @@ export function makeClient({ token }: { token?: string | null }) {

return new ApolloClient({
cache: new InMemoryCache(),
link: httpLink,
link: persistedQueryLink.concat(httpLink),
});
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"babel-plugin-react-compiler": "19.1.0-rc.3",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"crypto-hash": "^4.0.0",
"foxact": "^0.2.49",
"graphql": "^16.11.0",
"lucide-react": "^0.544.0",
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.