phoenix_live_view 0.19.2 → 0.19.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -96,11 +96,15 @@ var EntryUploader = class {
96
96
  this.offset = 0;
97
97
  this.chunkSize = chunkSize;
98
98
  this.chunkTimer = null;
99
+ this.errored = false;
99
100
  this.uploadChannel = liveSocket.channel(`lvu:${entry.ref}`, { token: entry.metadata() });
100
101
  }
101
102
  error(reason) {
103
+ if (this.errored) {
104
+ return;
105
+ }
106
+ this.errored = true;
102
107
  clearTimeout(this.chunkTimer);
103
- this.uploadChannel.leave();
104
108
  this.entry.error(reason);
105
109
  }
106
110
  upload() {
@@ -132,7 +136,7 @@ var EntryUploader = class {
132
136
  if (!this.isDone()) {
133
137
  this.chunkTimer = setTimeout(() => this.readNextChunk(), this.liveSocket.getLatencySim() || 0);
134
138
  }
135
- });
139
+ }).receive("error", ({ reason }) => this.error(reason));
136
140
  }
137
141
  };
138
142
 
@@ -299,7 +303,7 @@ var DOM = {
299
303
  wantsNewTab(e) {
300
304
  let wantsNewTab = e.ctrlKey || e.shiftKey || e.metaKey || e.button && e.button === 1;
301
305
  let isDownload = e.target instanceof HTMLAnchorElement && e.target.hasAttribute("download");
302
- let isTargetBlank = e.target.getAttribute("target") === "_blank";
306
+ let isTargetBlank = e.target.hasAttribute("target") && e.target.getAttribute("target").toLowerCase() === "_blank";
303
307
  return wantsNewTab || isTargetBlank || isDownload;
304
308
  },
305
309
  isUnloadableFormSubmit(e) {