uploads: autorefresh /uploads/:id page if upload is still processing.

Fixes an issue where if you were uploading a multi-image source, and you
clicked on a thumbnail that was still processing, then the page wouldn't
refresh when the processing was complete.
This commit is contained in:
evazion
2022-02-16 01:18:37 -06:00
parent 9a5a04d74e
commit 70f8d3d0c0
2 changed files with 9 additions and 3 deletions

View File

@@ -2,10 +2,12 @@
<p>You have reached your upload limit. Please wait for your pending uploads to be approved before uploading more.</p>
<p id="upload-limit">Upload Limit: <%= render "users/upload_limit", user: CurrentUser.user %></p>
<% elsif upload_media_asset.pending? %>
<p>Preparing to upload <%= external_link_to upload_media_asset.source_url %>...</p>
<% elsif upload_media_asset.processing? %>
<% elsif upload_media_asset.loading? %>
<p>Processing <%= external_link_to upload_media_asset.source_url %>...</p>
<% content_for(:html_header) do %>
<meta http-equiv="refresh" content="1">
<% end %>
<% elsif upload_media_asset.failed? %>
<p>Error: <%= upload_media_asset.error %>.</p>
<% else %>

View File

@@ -6,6 +6,10 @@
<p>Error: <%= @upload.error %>.</p>
<% elsif @upload.media_asset_count == 0 %>
<p>Processing upload...</p>
<% content_for(:html_header) do %>
<meta http-equiv="refresh" content="1">
<% end %>
<% elsif @upload.media_asset_count > 1 %>
<div id="p-multiple-asset-upload">
<%= render "multiple_asset_upload", upload: @upload %>