Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toast displays 2 times | SvelteKit #40

Open
ghost opened this issue Oct 11, 2022 · 2 comments
Open

Toast displays 2 times | SvelteKit #40

ghost opened this issue Oct 11, 2022 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 11, 2022

I'm using SvelteKit and this library to display toast notifications.
Making a project I discovered that calling any notifier function from the onMount of Svelte will duplicate the toast.

unknown

Steps to reproduce bug:

npm create svelte@latest 
my-app
cd my-app
npm install
npm i -D @beyonk/svelte-notifications
npm run dev

Paste the following code in the main +page.svelte:

<script>
    import { NotificationDisplay, notifier } from '@beyonk/svelte-notifications'
    import { onMount } from "svelte"
    let n

    onMount(()=>{
        notifier.success('test1', 7000)
        notifier.success('test2', 7000)
        console.log('test1')
        console.log('test2')
    })
</script>

<NotificationDisplay bind:this={n} />
@antony
Copy link
Member

antony commented Nov 12, 2022

interesting. we don't tend to call this from onMount, which is why we probably haven't encountered this issue.

@ghost
Copy link
Author

ghost commented Nov 24, 2022

I see. By the way this is still not solved yet.
To go further with my project I decided to change component and I used an other one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant