@shipstatic/drop 2.10.4-beta.8 → 2.10.4-beta.9

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.js CHANGED
@@ -1139,14 +1139,18 @@ function useDrop({ ship }) {
1139
1139
  ]);
1140
1140
  if (run.signal.aborted) return;
1141
1141
  if (files.length === 0) {
1142
- setState(initialState);
1142
+ setState({
1143
+ ...initialState,
1144
+ phase: "error",
1145
+ status: { title: "Empty Folder", details: "It has no files to deploy." }
1146
+ });
1143
1147
  return;
1144
1148
  }
1145
1149
  const outcome = await processFiles(files, {
1146
1150
  limits,
1147
- onStatus: (status) => {
1148
- if (!run.signal.aborted) setState((prev) => ({ ...prev, status }));
1149
- }
1151
+ // The pipeline says its status before its first wait, so a
1152
+ // cancelled run has none left to say.
1153
+ onStatus: (status) => setState((prev) => ({ ...prev, status }))
1150
1154
  });
1151
1155
  if (run.signal.aborted) return;
1152
1156
  setState({
@@ -1218,11 +1222,10 @@ function useDrop({ ship }) {
1218
1222
  if (file) files.push(file);
1219
1223
  }
1220
1224
  }
1221
- const plain = Array.from(e.dataTransfer.files);
1222
- if (directories.length === 0 && files.length === 0 && plain.length === 0) return;
1225
+ if (directories.length === 0 && files.length === 0) return;
1223
1226
  await prepare(async () => {
1224
1227
  await Promise.all(directories.map((d) => traverseFileTree(d.entry, files, d.path)));
1225
- return files.length > 0 ? files : plain;
1228
+ return files;
1226
1229
  });
1227
1230
  },
1228
1231
  [prepare]