@@ -130,6 +130,7 @@ import {
130130 remove_custom_skin ,
131131 type Skin ,
132132 type SkinModel ,
133+ type SkinTextureUrl ,
133134 unequip_skin ,
134135} from ' @/helpers/skins.ts'
135136
@@ -142,7 +143,7 @@ const currentSkin = ref<Skin | null>(null)
142143const shouldRestoreModal = ref (false )
143144const isSaving = ref (false )
144145
145- const uploadedTextureUrl = ref <string | null >(null )
146+ const uploadedTextureUrl = ref <SkinTextureUrl | null >(null )
146147const previewSkin = ref <string >(' ' )
147148
148149const variant = ref <SkinModel >(' CLASSIC' )
@@ -188,7 +189,7 @@ function getSortedCapeExcluding(excludeId: string): Cape | undefined {
188189
189190async function loadPreviewSkin() {
190191 if (uploadedTextureUrl .value ) {
191- previewSkin .value = uploadedTextureUrl .value
192+ previewSkin .value = uploadedTextureUrl .value . normalized
192193 } else if (currentSkin .value ) {
193194 try {
194195 previewSkin .value = await get_normalized_skin_texture (currentSkin .value )
@@ -253,11 +254,11 @@ async function show(e: MouseEvent, skin?: Skin) {
253254 modal .value ?.show (e )
254255}
255256
256- async function showNew(e : MouseEvent , skinTextureUrl : string ) {
257+ async function showNew(e : MouseEvent , skinTextureUrl : SkinTextureUrl ) {
257258 mode .value = ' new'
258259 currentSkin .value = null
259260 uploadedTextureUrl .value = skinTextureUrl
260- variant .value = await determineModelType (skinTextureUrl )
261+ variant .value = await determineModelType (skinTextureUrl . original )
261262 selectedCape .value = undefined
262263 visibleCapeList .value = []
263264 initVisibleCapeList ()
@@ -267,7 +268,7 @@ async function showNew(e: MouseEvent, skinTextureUrl: string) {
267268 modal .value ?.show (e )
268269}
269270
270- async function restoreWithNewTexture(skinTextureUrl : string ) {
271+ async function restoreWithNewTexture(skinTextureUrl : SkinTextureUrl ) {
271272 uploadedTextureUrl .value = skinTextureUrl
272273 await loadPreviewSkin ()
273274
@@ -361,7 +362,7 @@ async function save() {
361362 let textureUrl: string
362363
363364 if (uploadedTextureUrl .value ) {
364- textureUrl = uploadedTextureUrl .value
365+ textureUrl = uploadedTextureUrl .value . original
365366 } else {
366367 textureUrl = currentSkin .value ! .texture
367368 }
0 commit comments