@arbidocs/react 0.5.8 → 0.5.10

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/index.cjs CHANGED
@@ -3120,7 +3120,8 @@ function useUploadFiles() {
3120
3120
  const direct = settings?.use_s3_direct_upload === true;
3121
3121
  return React.useCallback(
3122
3122
  async (input, onProgress) => {
3123
- const workspaceId = arbi.getWorkspaceId();
3123
+ const openWorkspaceId2 = arbi.getWorkspaceId();
3124
+ const workspaceId = input.workspaceExtId ?? openWorkspaceId2;
3124
3125
  const groups = /* @__PURE__ */ new Map();
3125
3126
  for (const file of input.files) {
3126
3127
  const folder = uploadFolderOf(file, input.folder);
@@ -3131,7 +3132,7 @@ function useUploadFiles() {
3131
3132
  for (let i = 0; i < files.length; i += BATCH_SIZE2)
3132
3133
  batches.push({ folder, files: files.slice(i, i + BATCH_SIZE2) });
3133
3134
  let workspaceKey = null;
3134
- if (direct && resolveWorkspaceKey) {
3135
+ if (direct && workspaceId === openWorkspaceId2 && resolveWorkspaceKey) {
3135
3136
  try {
3136
3137
  workspaceKey = await resolveWorkspaceKey(workspaceId);
3137
3138
  } catch {
@@ -3178,6 +3179,7 @@ function useUploadFiles() {
3178
3179
  shared: input.shared,
3179
3180
  folder: folder ?? void 0,
3180
3181
  configExtId: input.configExtId ?? void 0,
3182
+ workspaceExtId: workspaceId !== openWorkspaceId2 ? workspaceId : void 0,
3181
3183
  onProgress: (loaded) => {
3182
3184
  loadedByBatch[index] = Math.min(loaded, bytes);
3183
3185
  report();