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

View File

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

View File

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