(feat): migrate ttp to mtp
Some checks failed
/ build-desktop (linux) (push) Failing after 3m58s
/ build-web (push) Failing after 4m13s
/ build-mobile (push) Failing after 6m34s
/ release (push) Has been skipped

(wip): crypto migration
This commit is contained in:
Alois 2026-07-05 01:43:06 +02:00
commit 930663d495
30 changed files with 559 additions and 749 deletions

View file

@ -4,7 +4,7 @@ import { useMTP } from "@tensamin/mtp";
import { mtp as schemas } from "@tensamin/shared/data";
import type z from "zod";
export type User = z.infer<typeof schemas.get_user_data.response>;
export type User = z.infer<typeof schemas.GetUserData.response>;
interface contextValue {
get(userId: number): Promise<User>;
@ -47,11 +47,11 @@ export default function UserProvider(props: { children: React.ReactNode }) {
}
const request = (async () => {
const userData = await send("get_user_data", { UserId: userId });
const userData = await send("GetUserData", { UserId: userId });
const user = {
...userData.data,
avatar: userData.data.avatar
? `data:image/webp;base64,${atob(userData.data.avatar)}`
avatar: userData.data.Avatar
? `data:image/webp;base64,${atob(userData.data.Avatar)}`
: undefined,
};