diff --git a/apps/app-frontend/src/App.vue b/apps/app-frontend/src/App.vue index cea0a0e4ef..a3d303d0b6 100644 --- a/apps/app-frontend/src/App.vue +++ b/apps/app-frontend/src/App.vue @@ -71,6 +71,7 @@ import PromotionWrapper from '@/components/ui/PromotionWrapper.vue' import QuickInstanceSwitcher from '@/components/ui/QuickInstanceSwitcher.vue' import RunningAppBar from '@/components/ui/RunningAppBar.vue' import SplashScreen from '@/components/ui/SplashScreen.vue' +import UpdateAvailableToast from '@/components/ui/UpdateAvailableToast.vue' import UpdateToast from '@/components/ui/UpdateToast.vue' import URLConfirmModal from '@/components/ui/URLConfirmModal.vue' import { useCheckDisableMouseover } from '@/composables/macCssFix.js' @@ -143,6 +144,7 @@ const showOnboarding = ref(false) const nativeDecorations = ref(false) const os = ref('') +const isDevEnvironment = ref(false) const stateInitialized = ref(false) @@ -247,6 +249,7 @@ async function setupApp() { os.value = await getOS() const dev = await isDev() + isDevEnvironment.value = dev const version = await getVersion() showOnboarding.value = !onboarded @@ -513,13 +516,13 @@ async function checkUpdates() { async function performCheck() { const update = await invoke('plugin:updater|check') - const isExistingUpdate = update.version === availableUpdate.value?.version - if (!update) { console.log('No update available') return } + const isExistingUpdate = update.version === availableUpdate.value?.version + if (isExistingUpdate) { console.log('Update is already known') return @@ -769,6 +772,7 @@ provideAppUpdateDownloadProgress(appUpdateDownload) @restart="installUpdate" @download="downloadAvailableUpdate" /> + diff --git a/apps/app-frontend/src/components/ui/UpdateAvailableToast.vue b/apps/app-frontend/src/components/ui/UpdateAvailableToast.vue new file mode 100644 index 0000000000..5db6a464e5 --- /dev/null +++ b/apps/app-frontend/src/components/ui/UpdateAvailableToast.vue @@ -0,0 +1,106 @@ + + diff --git a/apps/app-frontend/src/locales/en-US/index.json b/apps/app-frontend/src/locales/en-US/index.json index ed294cf0dc..225c9678e6 100644 --- a/apps/app-frontend/src/locales/en-US/index.json +++ b/apps/app-frontend/src/locales/en-US/index.json @@ -38,6 +38,9 @@ "app.update-toast.body.download-complete": { "message": "Modrinth App v{version} has finished downloading. Reload to update now, or automatically when you close Modrinth App." }, + "app.update-toast.body.linux": { + "message": "Modrinth App v{version} is ready to install! Restart the app to apply the update once it has been installed by your system." + }, "app.update-toast.body.metered": { "message": "Modrinth App v{version} is available now! Since you're on a metered network, we didn't automatically download it." }, @@ -47,12 +50,18 @@ "app.update-toast.download": { "message": "Download ({size})" }, + "app.update-toast.download-page": { + "message": "Download" + }, "app.update-toast.downloading": { "message": "Downloading..." }, "app.update-toast.reload": { "message": "Reload" }, + "app.update-toast.restart": { + "message": "Restart app" + }, "app.update-toast.title": { "message": "Update available" },