@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.cjs.js
CHANGED
|
@@ -9374,7 +9374,6 @@ class VaultUploadModule {
|
|
|
9374
9374
|
this.renderer = null;
|
|
9375
9375
|
this.attachedElements = new Map();
|
|
9376
9376
|
this.config = config;
|
|
9377
|
-
this.api = new UploadApi(config);
|
|
9378
9377
|
}
|
|
9379
9378
|
/**
|
|
9380
9379
|
* Upload a file to a vault.
|
|
@@ -9409,8 +9408,12 @@ class VaultUploadModule {
|
|
|
9409
9408
|
...options,
|
|
9410
9409
|
backdropBlur: options.backdropBlur ?? this.config.backdropBlur,
|
|
9411
9410
|
};
|
|
9411
|
+
// Fresh API instance per upload session: the AbortController inside the
|
|
9412
|
+
// api is single-use, so reusing it across modal opens would make every
|
|
9413
|
+
// request after the first close throw "Request cancelled".
|
|
9414
|
+
const api = new UploadApi(this.config);
|
|
9412
9415
|
return new Promise((resolve, reject) => {
|
|
9413
|
-
this.renderer = new UploadRenderer(container,
|
|
9416
|
+
this.renderer = new UploadRenderer(container, api, mergedOptions, {
|
|
9414
9417
|
onSuccess: (result) => {
|
|
9415
9418
|
options.onSuccess?.(result);
|
|
9416
9419
|
resolve(result);
|