diff --git a/apps/app-frontend/src/App.vue b/apps/app-frontend/src/App.vue index cea0a0e4ef..667e8aabf6 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 @@ -505,21 +508,23 @@ const restarting = ref(false) const updateToastDismissed = ref(false) const availableUpdate = ref(null) const updateSize = ref(null) +const updatesEnabled = ref(true) async function checkUpdates() { if (!(await areUpdatesEnabled())) { console.log('Skipping update check as updates are disabled in this build or environment') + updatesEnabled.value = false return } 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 +774,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..9b2f310636 --- /dev/null +++ b/apps/app-frontend/src/components/ui/UpdateAvailableToast.vue @@ -0,0 +1,84 @@ + + diff --git a/apps/app-frontend/src/locales/en-US/index.json b/apps/app-frontend/src/locales/en-US/index.json index ed294cf0dc..ebf577e377 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 available. Use your package manager to update for the latest features and fixes!" + }, "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,6 +50,9 @@ "app.update-toast.download": { "message": "Download ({size})" }, + "app.update-toast.download-page": { + "message": "Download" + }, "app.update-toast.downloading": { "message": "Downloading..." },