@teambit/workspace 0.0.749 → 0.0.752

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/workspace.js CHANGED
@@ -221,16 +221,6 @@ function _legacyBitId() {
221
221
  return data;
222
222
  }
223
223
 
224
- function _laneId() {
225
- const data = require("@teambit/lane-id");
226
-
227
- _laneId = function () {
228
- return data;
229
- };
230
-
231
- return data;
232
- }
233
-
234
224
  function _consumer2() {
235
225
  const data = require("@teambit/legacy/dist/consumer");
236
226
 
@@ -1006,29 +996,26 @@ class Workspace {
1006
996
 
1007
997
 
1008
998
  async getCurrentRemoteLane() {
1009
- const currentLane = this.getCurrentLaneId();
999
+ const currentLaneId = this.getCurrentLaneId();
1010
1000
 
1011
- if (currentLane.isDefault()) {
1012
- return null;
1013
- }
1014
-
1015
- const trackData = this.scope.legacyScope.lanes.getRemoteTrackedDataByLocalLane(currentLane.name);
1016
-
1017
- if (!trackData) {
1001
+ if (currentLaneId.isDefault()) {
1018
1002
  return null;
1019
1003
  }
1020
1004
 
1021
1005
  const scopeComponentImporter = _scopeComponentsImporter().default.getInstance(this.consumer.scope);
1022
1006
 
1023
- const laneId = _laneId().LaneId.from(trackData.remoteLane, trackData.remoteScope);
1024
-
1025
1007
  try {
1026
- const lanes = await scopeComponentImporter.importLanes([laneId]);
1027
- if (!lanes || lanes.length === 0) return null;
1008
+ const lanes = await scopeComponentImporter.importLanes([currentLaneId]);
1028
1009
  return lanes[0];
1029
1010
  } catch (err) {
1030
1011
  if (err instanceof _legacyBitId().InvalidScopeName || err instanceof _scopeNotFoundOrDenied().ScopeNotFoundOrDenied || err instanceof _laneNotFound().LaneNotFound || err instanceof _legacyBitId().InvalidScopeNameFromRemote) {
1031
- // the lane could be a local lane so no need to throw an error in such case
1012
+ const bitMapLaneId = this.bitMap.getExportedLaneId();
1013
+
1014
+ if (bitMapLaneId !== null && bitMapLaneId !== void 0 && bitMapLaneId.isEqual(currentLaneId)) {
1015
+ throw err; // we know the lane is not new, so the error is legit
1016
+ } // the lane could be a local lane so no need to throw an error in such case
1017
+
1018
+
1032
1019
  _loader().default.stop();
1033
1020
 
1034
1021
  this.logger.warn(`unable to get lane's data from a remote due to an error:\n${err.message}`);