Skip to content

Commit

Permalink
fix(snap), import from original lane in case of fork and the lane is …
Browse files Browse the repository at this point in the history
…new (#7734)
  • Loading branch information
davidfirst authored and zkochan committed Aug 7, 2023
1 parent 8a820b6 commit 2820435
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion scopes/component/snapping/snapping.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,16 @@ there are matching among unmodified components thought. consider using --unmodif

async _addFlattenedDependenciesToComponents(components: ConsumerComponent[]) {
loader.start('importing missing dependencies...');
const lane = await this.scope.legacyScope.getCurrentLaneObject();
const getLane = async () => {
const lane = await this.scope.legacyScope.getCurrentLaneObject();
if (!lane) return undefined;
if (!lane.isNew) return lane;
const forkedFrom = lane.forkedFrom;
if (!forkedFrom) return undefined;
return this.scope.legacyScope.loadLane(forkedFrom);
};
const lane = await getLane();

const flattenedDependenciesGetter = new FlattenedDependenciesGetter(
this.scope.legacyScope,
components,
Expand Down

0 comments on commit 2820435

Please sign in to comment.