@imposium-hub/components 1.38.0 → 1.38.1
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/constants/copy.ts +2 -1
- package/dist/components.js +2 -2
- package/dist/components.js.map +1 -1
- package/package.json +1 -1
- package/redux/actions/asset-uploads.ts +2 -3
- package/services/API.ts +10 -0
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ const assetUploadsActions : any = {
|
|
|
6
6
|
TOGGLE_ASSIGN_TO_STORY: 'assetUploads/TOGGLE_ASSIGN_TO_STORY',
|
|
7
7
|
ADD_UPLOAD: 'assetUploads/ADD_UPLOAD',
|
|
8
8
|
UPDATE_PERCENT_UPLOADED: 'assetUploads/UPDATE_PERCENT_UPLOADED',
|
|
9
|
-
REMOVE_UPLOAD: 'assetUploads/REMOVE_UPLOAD'
|
|
9
|
+
REMOVE_UPLOAD: 'assetUploads/REMOVE_UPLOAD',
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
const POLL_INTERVAL : number = 5000;
|
|
@@ -78,12 +78,11 @@ export const uploadAssets = (api : IImposiumAPI, files : File[], storyId : strin
|
|
|
78
78
|
|
|
79
79
|
return jobIdExists;
|
|
80
80
|
});
|
|
81
|
-
|
|
82
81
|
if (ongoingJobs.length > 0) {
|
|
83
82
|
pollAssetJobs(api, ongoingJobs, processingTimeout);
|
|
84
83
|
}
|
|
85
84
|
})
|
|
86
|
-
.catch((e : Error
|
|
85
|
+
.catch((e : Error) => {
|
|
87
86
|
console.error('Error(s) uploading footage: ', e);
|
|
88
87
|
});
|
|
89
88
|
};
|
package/services/API.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import axios, {AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosError, CancelToken, CancelTokenSource } from 'axios';
|
|
2
2
|
import { isObjEmpty } from '../Util';
|
|
3
3
|
import { JOB_TYPES } from '../constants/api';
|
|
4
|
+
import {assets as copy} from '../constants/copy';
|
|
5
|
+
import AuthService from './Auth0';
|
|
6
|
+
import SessionService from './Session';
|
|
4
7
|
|
|
5
8
|
export interface IImposiumAPI {
|
|
6
9
|
|
|
@@ -124,6 +127,13 @@ export default class API {
|
|
|
124
127
|
})
|
|
125
128
|
.catch((e : AxiosError) => {
|
|
126
129
|
if (!axios.isCancel(e) && reqAlias) { this.clearCache(reqAlias); }
|
|
130
|
+
if (e.response.status === 403 || e.response.status === 401) {
|
|
131
|
+
alert(copy.sessionExpired);
|
|
132
|
+
if (SessionService.getSession()) {
|
|
133
|
+
SessionService.removeSession();
|
|
134
|
+
AuthService.logout();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
127
137
|
reject(e);
|
|
128
138
|
});
|
|
129
139
|
});
|