@overmap-ai/core 1.0.53-add-agent-conversations.11 → 1.0.53-add-agent-conversations.13

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.
@@ -6605,7 +6605,7 @@ class MainService extends BaseApiService {
6605
6605
  if (replaceExisting) {
6606
6606
  this.client.store.dispatch(setIsFetchingInitialData(true));
6607
6607
  }
6608
- return this.enqueueRequest({
6608
+ const result = await this.enqueueRequest({
6609
6609
  uuid,
6610
6610
  description: "Get initial data",
6611
6611
  method: HttpMethod.GET,
@@ -6614,10 +6614,8 @@ class MainService extends BaseApiService {
6614
6614
  isAuthNeeded: true,
6615
6615
  blockers: [],
6616
6616
  blocks: []
6617
- }).then((result) => {
6618
- void this._processInitialData(result, replaceExisting);
6619
- return result;
6620
6617
  });
6618
+ void this._processInitialData(result, replaceExisting);
6621
6619
  }
6622
6620
  async fetchProjectUsers() {
6623
6621
  const projectId = this.client.store.getState().projectReducer.activeProjectId;
@@ -6644,12 +6642,12 @@ class MainService extends BaseApiService {
6644
6642
  // TODO:
6645
6643
  // Don't accept updateStore in ComponentService.list. Just return the offline objects and promise. Here, if
6646
6644
  // overwrite, use setComponents. Otherwise, use bulkAddComponents.
6647
- // TODO: This needs major cleanup
6645
+ // TODO: This needs major cleanup. Send less in the initial data: Only the basic project info and anything needed
6646
+ // literally immediately.
6648
6647
  async _processInitialData(data, overwrite) {
6649
6648
  var _a2, _b, _c;
6650
6649
  const workspaces = {};
6651
6650
  const projects = [];
6652
- const categories = [];
6653
6651
  const projectsData = data.projects;
6654
6652
  const { store } = this.client;
6655
6653
  const oldProjectId = (_a2 = projectsData.find(
@@ -6673,18 +6671,11 @@ class MainService extends BaseApiService {
6673
6671
  isProjectIdValid = true;
6674
6672
  for (const workspaceData of projectData.workspaces) {
6675
6673
  const workspace = { ...workspaceData, project: projectData.id };
6676
- if (workspace.categories) {
6677
- for (const category of workspace.categories) {
6678
- categories.push(category);
6679
- }
6680
- }
6681
- delete workspace.categories;
6682
6674
  workspaces[workspace.offline_id] = workspace;
6683
6675
  }
6684
6676
  }
6685
6677
  }
6686
6678
  store.dispatch(setCurrentUser(data.user));
6687
- store.dispatch(addUsers(data.project_owners));
6688
6679
  store.dispatch(setLicenses(data.licenses));
6689
6680
  const organizationsData = data.organizations;
6690
6681
  store.dispatch(setOrganizations(organizationsData));
@@ -6719,12 +6710,6 @@ class MainService extends BaseApiService {
6719
6710
  if (projectData) {
6720
6711
  for (const workspaceData of projectData.workspaces) {
6721
6712
  const workspace = { ...workspaceData, project: projectData.id };
6722
- if (workspace.categories) {
6723
- for (const category of workspace.categories) {
6724
- categories.push(category);
6725
- }
6726
- }
6727
- delete workspace.categories;
6728
6713
  workspaces[workspace.offline_id] = workspace;
6729
6714
  }
6730
6715
  }
@@ -6783,13 +6768,11 @@ class MainService extends BaseApiService {
6783
6768
  console.log("Overwriting data");
6784
6769
  store.dispatch(setProjects(projects));
6785
6770
  store.dispatch(setWorkspaces(workspaces));
6786
- store.dispatch(setCategories(categories));
6787
6771
  store.dispatch(resetRecentIssues());
6788
6772
  } else {
6789
6773
  console.log("Updating data (collisions will be replaced)");
6790
6774
  store.dispatch(addOrReplaceProjects(projects));
6791
6775
  store.dispatch(addOrReplaceWorkspaces(workspaces));
6792
- store.dispatch(addOrReplaceCategories(categories));
6793
6776
  }
6794
6777
  }
6795
6778
  }