Skip to content

Commit

Permalink
API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andcool-Systems committed Jan 4, 2025
1 parent 28366fe commit e009b9b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
18 changes: 7 additions & 11 deletions src/app/workshop/[id]/bandage_engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ import asyncImage, { base64Encode } from '@/app/modules/utils/asyncImage';
import ApiManager from '@/app/modules/utils/apiManager';

export interface SkinResponse {
data: {
skin: {
data: string,
slim: boolean
},
cape: string
}
skin: string,
cape: string,
slim: boolean
}

export const b64Prefix = "data:image/png;base64,";
Expand Down Expand Up @@ -79,11 +75,11 @@ class Client {
if (!nickname) return;

const data = await ApiManager.getSkin(nickname);
this.slim = data.data.skin.slim;
this.slim = data.slim;

this.setOriginalCanvas(b64Prefix + data.data.skin.data, () => {
this.skin = b64Prefix + data.data.skin;
this.cape = b64Prefix + data.data.cape;
this.setOriginalCanvas(b64Prefix + data.skin, () => {
this.skin = b64Prefix + data.skin;
this.cape = b64Prefix + data.cape;

this.rerender();
});
Expand Down
6 changes: 3 additions & 3 deletions src/app/workshop/[id]/components/skinLoad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const SkinLoad = ({ expanded, onChange }: SkinLoadProps) => {
ApiManager.getSkin(nickname)
.then(data => {
setData({
data: b64Prefix + data.data.skin.data,
slim: data.data.skin.slim,
cape: data.data.cape
data: b64Prefix + data.skin,
slim: data.slim,
cape: data.cape
});
setLoaded(true);
})
Expand Down

0 comments on commit e009b9b

Please sign in to comment.