upload: info message to let the user know that pause button applies to queued files only

Massimo Melina committed Sep 17, 2023 at 10:43 UTC e9cfaafa2cd6d38627e7a2797d0462cc1f1e6fc7
1 file changed +7 -2
frontend/src/upload.ts
+7 -2
@@ -68,6 +68,7 @@ setInterval(() => {
68
69 let reloadOnClose = false
70 let uploadDialogIsOpen = false
71 +let everPaused = false
72
73 function resetCounters() {
74 Object.assign(uploadState, {
@@ -141,12 +142,16 @@ export function showUpload() {
142 qs.length > 0 && h('div', {},
143 h(Flex, { alignItems: 'center', justifyContent: 'center', borderTop: '1px dashed', padding: '.5em' },
144 [queueStr, etaStr].filter(Boolean).join(', '),
144 - iconBtn('trash', ()=> {
145 + inQ > 0 && iconBtn('trash', ()=> {
146 uploadState.qs = []
147 abortCurrentUpload()
148 }),
148 - iconBtn(paused ? 'play' : 'pause', () => {
149 + inQ > 0 && iconBtn(paused ? 'play' : 'pause', () => {
150 uploadState.paused = !uploadState.paused
151 + if (!everPaused) {
152 + everPaused = true
153 + alertDialog("Pause applies to the queue, but current file will still be uploaded")
154 + }
155 }),
156 ),
157 qs.map((q,idx) =>