Slight UI tweaks

This commit is contained in:
Josiah Glosson 2025-07-08 17:11:56 -05:00
parent 9aab6c3e08
commit 3d4d0afa59
3 changed files with 15 additions and 11 deletions

View File

@ -346,7 +346,7 @@ async function handleCommand(e) {
}
}
const updateAvailable = ref(false)
const availableUpdate = ref(null)
const updateModal = useTemplateRef('updateModal')
async function checkUpdates() {
if (!(await areUpdatesEnabled())) {
@ -361,12 +361,16 @@ async function checkUpdates() {
}
const update = await invoke('plugin:updater|check')
updateAvailable.value = !!update
if (updateAvailable.value) {
console.log(`Update ${update.version} is available. Showing update modal.`)
if (!!update) {
console.log(`Update ${update.version} is available.`)
if (update.version === availableUpdate.value?.version) {
console.log('Skipping update modal because the new version is the same as the dismissed update')
} else {
availableUpdate.value = update;
updateModal.value.show(update)
}
}
}
await performCheck()
setTimeout(
@ -471,8 +475,9 @@ function handleAuxClick(e) {
<PlusIcon />
</NavButton>
<div class="flex flex-grow"></div>
<NavButton v-if="updateAvailable" v-tooltip.right="'Install update'" :to="() => restartApp()">
<DownloadIcon />
<NavButton v-if="!!availableUpdate" v-tooltip.right="'Update available'" :to="() => updateModal.show(availableUpdate)">
<!-- TODO: Gray if updating on next restart -->
<DownloadIcon class="text-brand-green" />
</NavButton>
<NavButton v-tooltip.right="'Settings'" :to="() => $refs.settingsModal.show()">
<SettingsIcon />

View File

@ -21,7 +21,7 @@
{{ formatMessage(messages.later) }}
</button>
</ButtonStyled>
<ButtonStyled>
<ButtonStyled color="red">
<button>
{{ formatMessage(messages.skip) }}
</button>
@ -97,10 +97,9 @@ function onHide() {
function hide() {
modal.value!.hide()
onHide()
}
defineExpose({ show, isOpen })
defineExpose({ show, hide, isOpen })
</script>
<style scoped lang="scss"></style>

View File

@ -41,7 +41,7 @@
]
},
"productName": "Modrinth App",
"version": "../app-frontend/package.json",
"version": "0.9.0",
"mainBinaryName": "Modrinth App",
"identifier": "ModrinthApp",
"plugins": {