@@ -81,7 +81,7 @@ enum StateOfDownload {
8181 Done ,
8282}
8383
84- async function cancelAppDL ( item : IGameDownloadItem ) {
84+ async function cancelAppDL ( item : IGameDownloadItem ) {
8585 let sure = await showConfirmModal ( {
8686 title : "Cancel download" ,
8787 message : "Are you sure you want to cancel this download?" ,
@@ -103,8 +103,8 @@ function GameDownloadItem(props: { download: IGameDownloadItem }) {
103103 const downloadStatus = createMemo < {
104104 state : StateOfDownload ,
105105 download : IGameDownloadItem ,
106- manager ?: IDownloadManagerInfo
107-
106+ manager ?: IDownloadManagerInfo ,
107+ status ?: string ,
108108 } > ( ( ) => {
109109 let state = StateOfDownload . Downloading ;
110110 let manager : IDownloadManagerInfo | undefined = undefined ;
@@ -135,6 +135,7 @@ function GameDownloadItem(props: { download: IGameDownloadItem }) {
135135 state : state ,
136136 download : download ,
137137 manager : manager ,
138+ status : download . status ,
138139 }
139140 } ) ;
140141
@@ -144,8 +145,6 @@ function GameDownloadItem(props: { download: IGameDownloadItem }) {
144145 < div class = "h-full bg-accent transition-all" style = { ` width: ${ Math . floor ( downloadStatus ( ) . manager ! . percentage * 100 ) } %` } > </ div >
145146 </ div >
146147 </ Show >
147-
148-
149148 < div class = "p-4 flex flex-row" >
150149 < div class = "flex-grow" >
151150 < div class = "flex gap-2 items-baseline" >
@@ -155,12 +154,21 @@ function GameDownloadItem(props: { download: IGameDownloadItem }) {
155154 < div class = "text-xs " >
156155 < Show when = { downloadStatus ( ) . state === StateOfDownload . Downloading && downloadStatus ( ) . manager } >
157156 < span class = "text-accent" > Downloading | { Math . floor ( downloadStatus ( ) . manager ! . percentage * 100 ) } % | { downloadStatus ( ) . manager ! . speedString } | ETA: { downloadStatus ( ) . manager ! . eTAString } </ span >
157+ < Show when = { downloadStatus ( ) . status } >
158+ < span class = "text-gray-300" > | { downloadStatus ( ) . status } </ span >
159+ </ Show >
158160 </ Show >
159161 < Show when = { downloadStatus ( ) . state === StateOfDownload . Canceled } >
160162 < span class = "text-gray-300" > Canceled</ span >
163+ < Show when = { downloadStatus ( ) . status } >
164+ < span class = "text-gray-300" > | { downloadStatus ( ) . status } </ span >
165+ </ Show >
161166 </ Show >
162167 < Show when = { downloadStatus ( ) . state === StateOfDownload . Failed } >
163168 < span class = "text-red-500" > Failed</ span >
169+ < Show when = { downloadStatus ( ) . status } >
170+ < span class = "text-gray-300" > | { downloadStatus ( ) . status } </ span >
171+ </ Show >
164172 </ Show >
165173 < Show when = { downloadStatus ( ) . state === StateOfDownload . Done } >
166174 < span class = "text-accent" > Done</ span >
@@ -170,8 +178,7 @@ function GameDownloadItem(props: { download: IGameDownloadItem }) {
170178 </ div >
171179 < div class = "flex flex-row gap-2" >
172180 < Show when = { downloadStatus ( ) . state === StateOfDownload . Downloading && downloadStatus ( ) . manager } >
173-
174- < IconButton color = 'info' onClick = { ( ) => cancelAppDL ( props . download ) } >
181+ < IconButton color = 'info' onClick = { ( ) => cancelAppDL ( props . download ) } >
175182 < FiX />
176183 </ IconButton >
177184 </ Show >
0 commit comments