@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.
@@ -732,7 +732,14 @@ var __publicField = (obj, key, value) => {
732
732
  if (!hash) {
733
733
  hash = await hashFile(file);
734
734
  }
735
- return `${hash}.${file.type.split("/")[1]}`;
735
+ let fileType = file.type;
736
+ if (fileType.includes("/")) {
737
+ fileType = fileType.split("/")[1];
738
+ }
739
+ if (!fileType) {
740
+ throw new Error(`Could not extract file type from ${file.type}`);
741
+ }
742
+ return `${hash}.${fileType}`;
736
743
  };
737
744
  function hashFile(file) {
738
745
  return new Promise((resolve, reject) => {
@@ -3310,7 +3317,7 @@ var __publicField = (obj, key, value) => {
3310
3317
  await checkToken();
3311
3318
  } catch (e) {
3312
3319
  if (e instanceof APIError) {
3313
- client.auth.logout();
3320
+ await client.auth.logout();
3314
3321
  return Promise.reject(e);
3315
3322
  }
3316
3323
  }
@@ -3402,7 +3409,7 @@ var __publicField = (obj, key, value) => {
3402
3409
  const loggedIn = state.authReducer.isLoggedIn;
3403
3410
  if (loggedIn) {
3404
3411
  console.warn("Signing out already signed-in user.");
3405
- client.auth.logout();
3412
+ await client.auth.logout();
3406
3413
  } else {
3407
3414
  console.warn("No signed-in user to sign out.");
3408
3415
  }