1
1
<template >
2
- <ModalWrapper
3
- ref =" modal"
4
- :header =" formatMessage(messages.header)"
5
- :on-hide =" onHide"
6
- :closable =" !updatingImmediately && !downloadInProgress"
7
- >
2
+ <ModalWrapper ref =" modal" hide-header :closable =" false" :on-hide =" onHide" >
8
3
<div class =" flex flex-col gap-4" >
9
- <div class =" max- w-[500px]" >
10
- <div class =" font-extrabold text-contrast text-xl mb-1 " >
11
- Modrinth App v{{ update!.version }}
4
+ <div class =" w-[500px]" >
5
+ <div class =" font-extrabold text-contrast text-xl" >
6
+ {{ formatMessage(messages.header) }} Modrinth App v{{ update!.version }}
12
7
</div >
13
8
<template v-if =" ! downloadInProgress && ! downloadError " >
14
- <div class =" mb-4 leading-tight" >{{ formatMessage(messages.bodyVersion) }}</div >
15
- <div class =" text-sm text-secondary mb-3 " >
9
+ <div class =" mb-1 leading-tight" >{{ formatMessage(messages.bodyVersion) }}</div >
10
+ <div class =" text-sm text-secondary mb-2 " >
16
11
{{ formatMessage(messages.downloadSize, { size: formatBytes(updateSize) }) }}
17
12
</div >
18
13
</template >
49
44
</ButtonStyled >
50
45
</div >
51
46
</div >
52
- <div v-if =" !downloadError" class =" flex flex-wrap gap-2 w-full mb-2 " >
47
+ <div v-if =" !downloadError" class =" flex flex-wrap gap-2 w-full" >
53
48
<JoinedButtons
54
49
:actions =" installActions"
55
50
:disabled =" updatingImmediately || downloadInProgress"
@@ -74,7 +69,7 @@ import { defineMessages, useVIntl } from '@vintl/vintl'
74
69
import { useTemplateRef , ref , computed } from ' vue'
75
70
import { AppearingProgressBar , ButtonStyled , JoinedButtons } from ' @modrinth/ui'
76
71
import type { JoinedButtonAction } from ' @modrinth/ui'
77
- import { ExternalIcon , DownloadIcon , RedoIcon , ClipboardCopyIcon } from ' @modrinth/assets'
72
+ import { ExternalIcon , DownloadIcon , RedoIcon , ClipboardCopyIcon , XIcon } from ' @modrinth/assets'
78
73
import { enqueueUpdateForInstallation , getUpdateSize } from ' @/helpers/utils'
79
74
import { formatBytes } from ' @modrinth/utils'
80
75
import { handleError } from ' @/store/notifications'
@@ -85,13 +80,14 @@ import { ChatIcon } from '@/assets/icons'
85
80
86
81
const emit = defineEmits <{
87
82
(e : ' updateEnqueuedForLater' , version : string | null ): Promise <void >
83
+ (e : ' modalHidden' ): void
88
84
}>()
89
85
90
86
const { formatMessage } = useVIntl ()
91
87
const messages = defineMessages ({
92
88
header: {
93
89
id: ' app.update.modal-header' ,
94
- defaultMessage: ' An update is available! ' ,
90
+ defaultMessage: ' Update available - ' ,
95
91
},
96
92
copiedError: {
97
93
id: ' app.update.copied-error' ,
@@ -131,6 +127,10 @@ const messages = defineMessages({
131
127
id: ' app.update.try-again' ,
132
128
defaultMessage: ' Try again' ,
133
129
},
130
+ hide: {
131
+ id: ' app.update.hide' ,
132
+ defaultMessage: ' Hide update reminder' ,
133
+ },
134
134
})
135
135
136
136
type UpdateData = {
@@ -146,7 +146,7 @@ const update = ref<UpdateData>()
146
146
const updateSize = ref <number >()
147
147
148
148
const updatingImmediately = ref (false )
149
- const downloadInProgress = ref (true )
149
+ const downloadInProgress = ref (false )
150
150
const downloadProgress = ref (0 )
151
151
const copiedError = ref (false )
152
152
const downloadError = ref <Error | null >(null )
@@ -167,6 +167,15 @@ const installActions = computed<JoinedButtonAction[]>(() => [
167
167
icon: RedoIcon ,
168
168
action: updateAtNextExit ,
169
169
},
170
+ {
171
+ id: ' hide' ,
172
+ label: formatMessage (messages .hide ),
173
+ action : () => {
174
+ hide ()
175
+ emit (' modalHidden' )
176
+ },
177
+ icon: XIcon ,
178
+ },
170
179
])
171
180
172
181
const downloadedBytes = computed (() => {
0 commit comments