@overmap-ai/core 1.0.18 → 1.0.19
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/overmap-core.js
CHANGED
|
@@ -744,7 +744,14 @@ const getFileS3Key = async (file, hash) => {
|
|
|
744
744
|
if (!hash) {
|
|
745
745
|
hash = await hashFile(file);
|
|
746
746
|
}
|
|
747
|
-
|
|
747
|
+
let fileType = file.type;
|
|
748
|
+
if (fileType.includes("/")) {
|
|
749
|
+
fileType = fileType.split("/")[1];
|
|
750
|
+
}
|
|
751
|
+
if (!fileType) {
|
|
752
|
+
throw new Error(`Could not extract file type from ${file.type}`);
|
|
753
|
+
}
|
|
754
|
+
return `${hash}.${fileType}`;
|
|
748
755
|
};
|
|
749
756
|
function hashFile(file) {
|
|
750
757
|
return new Promise((resolve, reject) => {
|
|
@@ -3322,7 +3329,7 @@ async function performRequest(action, client) {
|
|
|
3322
3329
|
await checkToken();
|
|
3323
3330
|
} catch (e) {
|
|
3324
3331
|
if (e instanceof APIError) {
|
|
3325
|
-
client.auth.logout();
|
|
3332
|
+
await client.auth.logout();
|
|
3326
3333
|
return Promise.reject(e);
|
|
3327
3334
|
}
|
|
3328
3335
|
}
|
|
@@ -3414,7 +3421,7 @@ async function performRequest(action, client) {
|
|
|
3414
3421
|
const loggedIn = state.authReducer.isLoggedIn;
|
|
3415
3422
|
if (loggedIn) {
|
|
3416
3423
|
console.warn("Signing out already signed-in user.");
|
|
3417
|
-
client.auth.logout();
|
|
3424
|
+
await client.auth.logout();
|
|
3418
3425
|
} else {
|
|
3419
3426
|
console.warn("No signed-in user to sign out.");
|
|
3420
3427
|
}
|