bruce-models 4.1.9 → 4.2.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.
@@ -8946,7 +8946,10 @@ var Tileset;
8946
8946
  if (!api) {
8947
8947
  api = ENVIRONMENT.Api().GetBruceApi();
8948
8948
  }
8949
- let isNew = !data.id;
8949
+ // We check if the tileset has settings.
8950
+ // This is to stop invalid responses from API when we make new tilesets and call an update on them.
8951
+ const hasSettings = data.settings && Object.keys(data.settings).length > 0;
8952
+ const isNew = !data.id;
8950
8953
  if (isNew) {
8951
8954
  const res = yield api.GET(`tileset/new?type=${data.type}&name=${Api.Encode(data.name)}`, reqParams);
8952
8955
  data = Object.assign(Object.assign(Object.assign({}, res), data), { settings: Object.assign(Object.assign({}, res.settings), data.settings), id: res.id });
@@ -8957,8 +8960,8 @@ var Tileset;
8957
8960
  yield api.POST(`ui.tileset/${data.id}`, legacy, Api.PrepReqParams(reqParams));
8958
8961
  }
8959
8962
  else {
8960
- // We avoid saving again if there are no settings and it is new.
8961
- if (!isNew || (data.settings && Object.keys(data.settings).length > 0)) {
8963
+ // Avoid calling an update on a new tileset with no settings.
8964
+ if (!isNew || hasSettings) {
8962
8965
  yield api.POST(`tileset/update/${data.id}`, data, Api.PrepReqParams(reqParams));
8963
8966
  }
8964
8967
  }
@@ -13161,7 +13164,7 @@ var DataSource;
13161
13164
  })(DataSource || (DataSource = {}));
13162
13165
 
13163
13166
  // This is updated with the package.json version on build.
13164
- const VERSION = "4.1.9";
13167
+ const VERSION = "4.2.1";
13165
13168
 
13166
13169
  export { VERSION, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityTypeVisualSettings, EntityAttribute, EntityHistoricData, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, AccountFeatures, AccountLimits, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, ImportCad, ImportCsv, ImportJson, ImportKml, ImportedFile, Markup, Uploader, Plugin, ENVIRONMENT, DataSource };
13167
13170
  //# sourceMappingURL=bruce-models.es5.js.map