mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-08-26 10:36:16 -05:00
Merge pull request #448 from PretendoNetwork/fix/mii-editor-crash
Fix/mii editor crash + various fixes
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { watchImmediate } from '@vueuse/core';
|
||||
import DefaultLayout from './layouts/default.vue';
|
||||
const { error } = defineProps<{ error: any }>();
|
||||
|
||||
watchImmediate([error], () => {
|
||||
console.error(error);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -784,7 +784,7 @@ fieldset {
|
||||
align-items: center;
|
||||
flex: 50%;
|
||||
color: var(--text-shade-1);
|
||||
padding: 40px;
|
||||
padding: 30px 10px;
|
||||
justify-content: space-between;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import Mii from '@pretendonetwork/mii-js';
|
||||
import { watchOnce } from '@vueuse/core';
|
||||
import BirthdaySetter from '@/components/BirthdaySetter/BirthdaySetter.vue';
|
||||
import { miiEditorJSON } from '@/utils/miieditor';
|
||||
import type { ApiAccountUpdateRequest } from '~~/shared/api-types';
|
||||
@@ -65,9 +66,7 @@ const newMiiSmileUrl = computed(() => {
|
||||
});
|
||||
|
||||
function base64ToArrayBuffer(base64: string): ArrayBuffer {
|
||||
const binaryString = atob(base64);
|
||||
const binaryArray = new TextEncoder().encode(binaryString);
|
||||
return binaryArray.buffer;
|
||||
return new Uint8Array([...atob(base64)].map(v => v.charCodeAt(0))).buffer;
|
||||
}
|
||||
|
||||
// this initalizes a mii for editing
|
||||
@@ -89,7 +88,8 @@ function initializeMiiData(encodedUserMiiData: string) {
|
||||
bgColor: '13173300',
|
||||
expression: 'sorrow'
|
||||
});
|
||||
} catch {
|
||||
} catch (err) {
|
||||
console.error('Failed to load mii data', err);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ async function renderMii(_e?: Event, sizeChange?: boolean) {
|
||||
loadingCanvas.value = false;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
watchOnce(miiCanvas, () => {
|
||||
renderMii();
|
||||
});
|
||||
|
||||
@@ -58,9 +58,9 @@ export function useAuthStore() {
|
||||
|
||||
function refresh() {
|
||||
authState.value = authState.value;
|
||||
accessTokenCookie.value = accessTokenCookie.value;
|
||||
refreshTokenCookie.value = refreshTokenCookie.value;
|
||||
tokenTypeCookie.value = tokenTypeCookie.value;
|
||||
accessTokenCookie.value = authState.value?.accessToken ?? null;
|
||||
refreshTokenCookie.value = authState.value?.refreshToken ?? null;
|
||||
tokenTypeCookie.value = authState.value ? oldCookieTokenType : null;
|
||||
}
|
||||
|
||||
function set(val: AuthState | null) {
|
||||
|
||||
Reference in New Issue
Block a user