Skip to content

Commit 416b690

Browse files
authored
Merge branch 'main' into dev
2 parents 9961d4a + ed04954 commit 416b690

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.github/workflows/nodejs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323
if: ${{ github.event_name != 'pull_request' }}
2424
steps:
25-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
25+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
2626
name: Checkout [main]
2727
with:
2828
fetch-depth: 0
@@ -63,7 +63,7 @@ jobs:
6363
runs-on: ubuntu-latest
6464
if: ${{ github.event_name == 'pull_request' }}
6565
steps:
66-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
66+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
6767
with:
6868
ref: ${{ github.event.pull_request.head.ref }}
6969
repository: ${{ github.event.pull_request.head.repo.full_name }}

components/svelte/src/lib/Particles.svelte

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@
99
let cssClass = '';
1010
export { cssClass as class };
1111
let canStart = false;
12+
let mounted = false;
1213
1314
let style = '';
1415
export { style };
1516
export let options: ISourceOptions = {};
1617
export let url = '';
1718
export let id = 'tsparticles';
1819
19-
const dispatch = createEventDispatcher(),
20-
particlesLoadedEvent = 'particlesLoaded';
20+
const dispatch = createEventDispatcher<{
21+
particlesLoaded: { container: Container }
22+
}>(), particlesLoadedEvent = 'particlesLoaded';
2123
2224
let oldId = id;
2325
@@ -44,13 +46,14 @@
4446
});
4547
4648
onMount(() => {
49+
mounted = true;
4750
void loadParticles();
4851
});
4952
5053
async function loadParticles(): Promise<void> {
5154
destroyOldContainer();
5255
53-
if (!canStart) {
56+
if (!canStart || !mounted) {
5457
return;
5558
}
5659

0 commit comments

Comments
 (0)