Skip to content

Commit

Permalink
Merge pull request #32 from Joery-M/31-sl-ui-circular-dependency-in-c…
Browse files Browse the repository at this point in the history
…urrentproject

fix: Made import to main asynchronous
  • Loading branch information
Joery-M authored May 7, 2024
2 parents a8be3aa + 6c9d0bb commit 2699f85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
${{ runner.os }}-pnpm-store-
- name: Get installed Playwright version
run: echo "PLAYWRIGHT_VERSION=$(cat pnpm-lock.yaml | grep /playwright@ | sed -r 's/(.*@)([0-9.]*)(:)/\2/')" >> $GITHUB_ENV
run: echo "PLAYWRIGHT_VERSION=$(cat pnpm-lock.yaml | grep ' playwright@' | sed -r 's/(.*@)([0-9.]*)(:)/\2/' | head -1)" >> $GITHUB_ENV

- name: Install dependencies
run: pnpm install --ignore-scripts
Expand Down
4 changes: 2 additions & 2 deletions packages/safelight/src/stores/currentProject.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable no-dupe-class-members */
import { router } from '@/main';
import type BaseProject from '@safelight/shared/base/Project';
import { ProjectFeatures, type ProjectType } from '@safelight/shared/base/Project';
import BaseStorageController, { Storage, type StoredProject } from '@safelight/shared/base/Storage';
Expand Down Expand Up @@ -35,7 +34,8 @@ export class CurrentProject {
}

public static async toEditor() {
await router.push('/editor');
// Prevent circular dependency
await (await import('../main')).router.push('/editor');
}

public static async newSimpleProject(goToEditor = true) {
Expand Down

0 comments on commit 2699f85

Please sign in to comment.