Skip to content

Commit

Permalink
fix: Adjust the update version display
Browse files Browse the repository at this point in the history
  • Loading branch information
ci010 committed Mar 29, 2024
1 parent 5f15012 commit 0aa3a61
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions xmcl-keystone-ui/src/views/HomeInstanceUpdateDialog.vue
Expand Up @@ -29,7 +29,7 @@

<div class="grid grid-cols-2 gap-4">
<v-text-field
:value="`${oldRuntime.minecraft} -> ${runtime.minecraft}`"
:value="getVersionString(oldRuntime.minecraft, runtime.minecraft)"
persistent-hint
label="Minecraft"
readonly
Expand All @@ -46,7 +46,7 @@
</v-text-field>
<v-text-field
v-if="runtime.forge"
:value="`${oldRuntime.forge} -> ${runtime.forge}`"
:value="getVersionString(oldRuntime.forge, runtime.forge)"
persistent-hint
label="Forge"
readonly
Expand All @@ -63,7 +63,7 @@
</v-text-field>
<v-text-field
v-if="runtime.fabricLoader"
:value="`${oldRuntime.fabricLoader} -> ${runtime.fabricLoader}`"
:value="getVersionString(oldRuntime.fabricLoader, runtime.fabricLoader)"
persistent-hint
readonly
label="Fabric"
Expand Down Expand Up @@ -177,6 +177,8 @@ const tOperations = computed(() => ({
const { getColorCode } = useVuetifyColor()
const runtime = computed(() => upgrade.value?.instance.runtime || {} as Record<string, string>)
const getVersionString = (oldVersion?: string, newVersion?: string) => oldVersion !== newVersion ? `${oldVersion} -> ${newVersion}` : newVersion
const cOperations = {
add: 'green',
remove: 'red',
Expand Down

0 comments on commit 0aa3a61

Please sign in to comment.