From b2df83d61852c9d0492ea23296ffc469a35031ab Mon Sep 17 00:00:00 2001 From: Jai A Date: Thu, 29 Aug 2024 17:23:59 -0700 Subject: [PATCH] Fix auto updater, add failure message, fix modals --- apps/app-frontend/index.html | 2 +- apps/app-frontend/src/App.vue | 28 ++++++++++ .../src/components/ui/AccountsCard.vue | 13 ++++- .../src/components/ui/ContextMenu.vue | 3 + .../src/components/ui/ErrorModal.vue | 6 +- .../src/components/ui/ExportModal.vue | 10 ++-- .../components/ui/InstanceCreationModal.vue | 10 ++-- .../src/components/ui/JavaDetectionModal.vue | 10 ++-- .../src/components/ui/ModpackVersionModal.vue | 11 ++-- .../src/components/ui/SplashScreen.vue | 7 +++ .../src/components/ui/URLConfirmModal.vue | 7 ++- .../IncompatibilityWarningModal.vue | 16 ++---- .../ui/install_flow/InstallConfirmModal.vue | 15 ++--- .../ui/install_flow/ModInstallModal.vue | 14 ++--- .../src/components/ui/modal/ModalWrapper.vue | 49 ++++++++++++++++ .../ui/tutorial/ModrinthLoginScreen.vue | 11 ++-- apps/app-frontend/src/helpers/ads.js | 4 ++ apps/app-frontend/src/pages/instance/Mods.vue | 10 ++-- .../src/pages/instance/Options.vue | 26 +++------ apps/app/build.rs | 1 + apps/app/capabilities/plugins.json | 2 +- apps/app/gen/schemas/acl-manifests.json | 2 +- apps/app/gen/schemas/desktop-schema.json | 14 +++++ apps/app/gen/schemas/macOS-schema.json | 14 +++++ apps/app/src/api/ads.rs | 47 +++++++++++++++- apps/app/src/api/mod.rs | 12 ++++ apps/app/src/main.rs | 56 ++++++++++++++++++- packages/app-lib/src/api/jre.rs | 8 +-- packages/app-lib/src/api/pack/import/mod.rs | 2 +- packages/app-lib/src/api/pack/install_from.rs | 12 ++-- .../app-lib/src/api/pack/install_mrpack.rs | 5 +- packages/app-lib/src/api/profile/mod.rs | 2 +- packages/app-lib/src/event/emit.rs | 27 +++++---- packages/app-lib/src/event/mod.rs | 13 +++-- packages/app-lib/src/launcher/download.rs | 6 +- packages/app-lib/src/launcher/mod.rs | 8 +-- packages/app-lib/src/lib.rs | 2 +- packages/app-lib/src/state/dirs.rs | 12 ++-- packages/app-lib/src/util/fetch.rs | 3 +- packages/assets/styles/classes.scss | 2 +- .../ui/src/components/base/MarkdownEditor.vue | 2 +- 41 files changed, 351 insertions(+), 153 deletions(-) create mode 100644 apps/app-frontend/src/components/ui/modal/ModalWrapper.vue diff --git a/apps/app-frontend/index.html b/apps/app-frontend/index.html index d535376f7..891f575f2 100644 --- a/apps/app-frontend/index.html +++ b/apps/app-frontend/index.html @@ -3,7 +3,7 @@ - + Modrinth App diff --git a/apps/app-frontend/src/App.vue b/apps/app-frontend/src/App.vue index 30976a333..ee2cef3ce 100644 --- a/apps/app-frontend/src/App.vue +++ b/apps/app-frontend/src/App.vue @@ -32,6 +32,8 @@ import { invoke } from '@tauri-apps/api/core' import { open } from '@tauri-apps/plugin-shell' import { get_opening_command, initialize_state } from '@/helpers/state' import { saveWindowState, StateFlags } from '@tauri-apps/plugin-window-state' +import { renderString } from '@modrinth/utils' +import { useFetch } from '@/helpers/fetch.js' const themeStore = useTheming() @@ -52,6 +54,8 @@ const os = ref('') const stateInitialized = ref(false) +const criticalErrorMessage = ref() + onMounted(async () => { await useCheckDisableMouseover() }) @@ -108,6 +112,16 @@ async function setupApp() { }), ) + useFetch( + `https://api.modrinth.com/appCriticalAnnouncement.json?version=${version}`, + 'criticalAnnouncements', + true, + ).then((res) => { + if (res.header && res.body) { + criticalErrorMessage.value = res + } + }) + get_opening_command().then(handleCommand) } @@ -266,6 +280,10 @@ async function handleCommand(e) {
+
+

{{ criticalErrorMessage.header }}

+
+