(msg)
| 209 | }; |
| 210 | |
| 211 | const setError = (msg) => { |
| 212 | if (!progressWrap) return; |
| 213 | progressWrap.classList.remove('is-indeterminate'); |
| 214 | progressWrap.classList.add('is-error'); |
| 215 | if (progressText) progressText.textContent = msg || tx('share_upload_failed', null, 'Upload failed.'); |
| 216 | }; |
| 217 | |
| 218 | uploadForm.addEventListener('submit', function (e) { |
| 219 | if (!fileInput || !fileInput.files || !fileInput.files.length) return; |