@sparkvault/sdk 1.23.7 → 1.23.8
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.
package/dist/sparkvault.esm.js
CHANGED
|
@@ -9370,7 +9370,6 @@ class VaultUploadModule {
|
|
|
9370
9370
|
this.renderer = null;
|
|
9371
9371
|
this.attachedElements = new Map();
|
|
9372
9372
|
this.config = config;
|
|
9373
|
-
this.api = new UploadApi(config);
|
|
9374
9373
|
}
|
|
9375
9374
|
/**
|
|
9376
9375
|
* Upload a file to a vault.
|
|
@@ -9405,8 +9404,12 @@ class VaultUploadModule {
|
|
|
9405
9404
|
...options,
|
|
9406
9405
|
backdropBlur: options.backdropBlur ?? this.config.backdropBlur,
|
|
9407
9406
|
};
|
|
9407
|
+
// Fresh API instance per upload session: the AbortController inside the
|
|
9408
|
+
// api is single-use, so reusing it across modal opens would make every
|
|
9409
|
+
// request after the first close throw "Request cancelled".
|
|
9410
|
+
const api = new UploadApi(this.config);
|
|
9408
9411
|
return new Promise((resolve, reject) => {
|
|
9409
|
-
this.renderer = new UploadRenderer(container,
|
|
9412
|
+
this.renderer = new UploadRenderer(container, api, mergedOptions, {
|
|
9410
9413
|
onSuccess: (result) => {
|
|
9411
9414
|
options.onSuccess?.(result);
|
|
9412
9415
|
resolve(result);
|