diff --git a/apps/app-frontend/src/App.vue b/apps/app-frontend/src/App.vue index f402277b6..601d7172a 100644 --- a/apps/app-frontend/src/App.vue +++ b/apps/app-frontend/src/App.vue @@ -65,6 +65,7 @@ import IncompatibilityWarningModal from '@/components/ui/install_flow/Incompatib import InstallConfirmModal from '@/components/ui/install_flow/InstallConfirmModal.vue' import ModInstallModal from '@/components/ui/install_flow/ModInstallModal.vue' import InstanceCreationModal from '@/components/ui/InstanceCreationModal.vue' +import MinecraftAuthErrorModal from '@/components/ui/minecraft-auth-error-modal/MinecraftAuthErrorModal.vue' import AppSettingsModal from '@/components/ui/modal/AppSettingsModal.vue' import AuthGrantFlowWaitModal from '@/components/ui/modal/AuthGrantFlowWaitModal.vue' import NavButton from '@/components/ui/NavButton.vue' @@ -388,6 +389,7 @@ loading.setEnabled(false) const error = useError() const errorModal = ref() +const minecraftAuthErrorModal = ref() const install = useInstall() const modInstallModal = ref() @@ -466,6 +468,7 @@ onMounted(() => { invoke('show_window') error.setErrorModal(errorModal.value) + error.setMinecraftAuthErrorModal(minecraftAuthErrorModal.value) install.setIncompatibilityWarningModal(incompatibilityWarningModal) install.setInstallConfirmModal(installConfirmModal) @@ -1131,6 +1134,7 @@ provideAppUpdateDownloadProgress(appUpdateDownload) + diff --git a/apps/app-frontend/src/components/ui/ErrorModal.vue b/apps/app-frontend/src/components/ui/ErrorModal.vue index 17a9dffc7..45392b297 100644 --- a/apps/app-frontend/src/components/ui/ErrorModal.vue +++ b/apps/app-frontend/src/components/ui/ErrorModal.vue @@ -33,6 +33,7 @@ const metadata = ref({}) defineExpose({ async show(errorVal, context, canClose = true, source = null) { + console.log(errorVal, context, canClose, source) closable.value = canClose if (errorVal.message && errorVal.message.includes('Minecraft authentication error:')) { diff --git a/apps/app-frontend/src/components/ui/minecraft-auth-error-modal/MinecraftAuthErrorModal.vue b/apps/app-frontend/src/components/ui/minecraft-auth-error-modal/MinecraftAuthErrorModal.vue new file mode 100644 index 000000000..16c2c9d2f --- /dev/null +++ b/apps/app-frontend/src/components/ui/minecraft-auth-error-modal/MinecraftAuthErrorModal.vue @@ -0,0 +1,184 @@ + + + diff --git a/apps/app-frontend/src/components/ui/minecraft-auth-error-modal/minecraft-auth-errors.ts b/apps/app-frontend/src/components/ui/minecraft-auth-error-modal/minecraft-auth-errors.ts new file mode 100644 index 000000000..5e33d7aaa --- /dev/null +++ b/apps/app-frontend/src/components/ui/minecraft-auth-error-modal/minecraft-auth-errors.ts @@ -0,0 +1,90 @@ +export interface MinecraftAuthError { + errorCode: string + whatHappened: string + stepsToFix: string[] +} + +export const minecraftAuthErrors: MinecraftAuthError[] = [ + { + errorCode: '2148916222', + whatHappened: + 'Your Minecraft/Xbox Live account requires age verification to comply with UK regulations. You must complete this before signing in.', + stepsToFix: [ + 'Go to the Minecraft Login page and sign in', + 'Follow the instructions to verify your age', + 'Once verified, try signing in again', + 'For additional help, visit UK age verification on Xbox', + ], + }, + { + errorCode: '2148916233', + whatHappened: "This account doesn't have an Xbox profile set up or doesn't own Minecraft.", + stepsToFix: [ + 'Make sure Minecraft is purchased on this account', + 'Visit Minecraft Login and sign in', + 'Complete Xbox profile setup if prompted', + 'Once finished, try signing in again', + ], + }, + { + errorCode: '2148916235', + whatHappened: "Xbox Live isn't available in your region, so sign-in is blocked.", + stepsToFix: [ + 'Xbox services must be supported in your country before you can sign in', + 'Check Xbox Availability for supported regions', + ], + }, + { + errorCode: '2148916236', + whatHappened: 'This account requires adult verification under South Korean regulations.', + stepsToFix: [ + 'Visit Xbox and sign in', + 'Complete the identity verification process', + 'Once finished, try signing in again', + ], + }, + { + errorCode: '2148916237', + whatHappened: 'This account requires adult verification under South Korean regulations.', + stepsToFix: [ + 'Visit Xbox and sign in', + 'Complete the identity verification process', + 'Once finished, try signing in again', + ], + }, + { + errorCode: '2148916238', + whatHappened: 'This account is underage and not linked to a Microsoft family group.', + stepsToFix: [ + 'Review the Family Setup Guide', + 'Join or create a family group as instructed', + 'Once finished, try signing in again', + ], + }, + { + errorCode: '2148916227', + whatHappened: 'This account was suspended for violating Xbox Community Standards.', + stepsToFix: [ + 'Visit Xbox Support and review the enforcement details', + 'Submit an appeal if one is available', + ], + }, + { + errorCode: '2148916229', + whatHappened: "This account is restricted and doesn't have permission to play online.", + stepsToFix: [ + 'Have a guardian sign in to Microsoft Family', + 'Update online play permissions', + 'Once finished, try signing in again', + ], + }, + { + errorCode: '2148916234', + whatHappened: "This account hasn't accepted Xbox's Terms of Service.", + stepsToFix: [ + 'Visit Xbox and sign in', + 'Accept the Terms if prompted', + 'Once finished, try signing in again', + ], + }, +] diff --git a/apps/app-frontend/src/store/error.js b/apps/app-frontend/src/store/error.js index 0e7213fe5..dfec21120 100644 --- a/apps/app-frontend/src/store/error.js +++ b/apps/app-frontend/src/store/error.js @@ -3,12 +3,24 @@ import { defineStore } from 'pinia' export const useError = defineStore('errorsStore', { state: () => ({ errorModal: null, + minecraftAuthErrorModal: null, }), actions: { setErrorModal(ref) { this.errorModal = ref }, + setMinecraftAuthErrorModal(ref) { + this.minecraftAuthErrorModal = ref + }, showError(error, context, closable = true, source = null) { + if ( + error.message && + error.message.includes('Minecraft authentication error:') && + this.minecraftAuthErrorModal + ) { + this.minecraftAuthErrorModal.show(error) + return + } this.errorModal.show(error, context, closable, source) }, }, diff --git a/packages/assets/generated-icons.ts b/packages/assets/generated-icons.ts index 22569d9b3..cc0f353e2 100644 --- a/packages/assets/generated-icons.ts +++ b/packages/assets/generated-icons.ts @@ -144,6 +144,7 @@ import _ManageIcon from './icons/manage.svg?component' import _MaximizeIcon from './icons/maximize.svg?component' import _MemoryStickIcon from './icons/memory-stick.svg?component' import _MessageIcon from './icons/message.svg?component' +import _MessagesSquareIcon from './icons/messages-square.svg?component' import _MicrophoneIcon from './icons/microphone.svg?component' import _MinimizeIcon from './icons/minimize.svg?component' import _MinusIcon from './icons/minus.svg?component' @@ -466,6 +467,7 @@ export const ManageIcon = _ManageIcon export const MaximizeIcon = _MaximizeIcon export const MemoryStickIcon = _MemoryStickIcon export const MessageIcon = _MessageIcon +export const MessagesSquareIcon = _MessagesSquareIcon export const MicrophoneIcon = _MicrophoneIcon export const MinimizeIcon = _MinimizeIcon export const MinusIcon = _MinusIcon diff --git a/packages/assets/icons/messages-square.svg b/packages/assets/icons/messages-square.svg new file mode 100644 index 000000000..68acfc88a --- /dev/null +++ b/packages/assets/icons/messages-square.svg @@ -0,0 +1,16 @@ + + + + +