File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
components/svelte/src/lib Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 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
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 }}
Original file line number Diff line number Diff line change 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
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
You can’t perform that action at this time.
0 commit comments