Skip to content

Commit

Permalink
FIX: Remove unnecessary audio/video parent element load (#10511)
Browse files Browse the repository at this point in the history
Meta report: https://meta.discourse.org/t/sending-many-requests-for-video-audio-upload-while-editing-post/161487

When typing in the composer we are sending a lot of unnecessary load() requests for the video/audio elements. This line was added months ago before we improved previewing/video thumbnails, which have improved things, so it is no longer required. After removing this line everything still works and no more additional requests are sent.
  • Loading branch information
martin-brennan committed Aug 24, 2020
1 parent 62f4fc7 commit 9022e45
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions app/assets/javascripts/pretty-text/addon/upload-short-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,6 @@ function _loadCachedShortUrls(uploadElements, siteSettings, opts) {

upload.src = url;

// this is necessary, otherwise because of the src change the
// video/audio just doesn't bother loading!
upload.parentElement.load();

// set the url and text for the <a> tag within the <video/audio> tag
const link = upload.parentElement.querySelector("a");
if (link) {
Expand Down

0 comments on commit 9022e45

Please sign in to comment.