@performant-software/semantic-components 1.0.4-beta.1 → 1.0.4-beta.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@performant-software/semantic-components",
3
- "version": "1.0.4-beta.1",
3
+ "version": "1.0.4-beta.2",
4
4
  "description": "A package of shared components based on the Semantic UI Framework.",
5
5
  "license": "MIT",
6
6
  "main": "./build/index.js",
@@ -12,7 +12,7 @@
12
12
  "build": "webpack --mode production && flow-copy-source -v src types"
13
13
  },
14
14
  "dependencies": {
15
- "@performant-software/shared-components": "^1.0.4-beta.1",
15
+ "@performant-software/shared-components": "^1.0.4-beta.2",
16
16
  "@react-google-maps/api": "^2.8.1",
17
17
  "axios": "^0.26.1",
18
18
  "citeproc": "^2.4.62",
@@ -253,7 +253,7 @@ const FileUploadModal: ComponentType<any> = (props: Props) => {
253
253
  *
254
254
  * @type {function(): Promise<void>}
255
255
  */
256
- const onValidate = useCallback(() => {
256
+ const onValidate = useCallback(() => new Promise((resolve, reject) => {
257
257
  let error = false;
258
258
 
259
259
  setItems((prevItems) => _.map(prevItems, (item) => {
@@ -266,8 +266,12 @@ const FileUploadModal: ComponentType<any> = (props: Props) => {
266
266
  return valid;
267
267
  }));
268
268
 
269
- return error ? Promise.reject() : Promise.resolve();
270
- }, [validateItem]);
269
+ if (error) {
270
+ reject();
271
+ } else {
272
+ resolve();
273
+ }
274
+ }), []);
271
275
 
272
276
  /**
273
277
  * Updates the passed item with the passed props.
@@ -253,7 +253,7 @@ const FileUploadModal: ComponentType<any> = (props: Props) => {
253
253
  *
254
254
  * @type {function(): Promise<void>}
255
255
  */
256
- const onValidate = useCallback(() => {
256
+ const onValidate = useCallback(() => new Promise((resolve, reject) => {
257
257
  let error = false;
258
258
 
259
259
  setItems((prevItems) => _.map(prevItems, (item) => {
@@ -266,8 +266,12 @@ const FileUploadModal: ComponentType<any> = (props: Props) => {
266
266
  return valid;
267
267
  }));
268
268
 
269
- return error ? Promise.reject() : Promise.resolve();
270
- }, [validateItem]);
269
+ if (error) {
270
+ reject();
271
+ } else {
272
+ resolve();
273
+ }
274
+ }), []);
271
275
 
272
276
  /**
273
277
  * Updates the passed item with the passed props.