From ec379c544d32807086e39efe1922a24a9e4822c9 Mon Sep 17 00:00:00 2001 From: Sylvain Marroufin Date: Wed, 9 Feb 2022 13:23:53 +0100 Subject: [PATCH 1/2] feat(toast): expose `timeout` to alias methods --- src/runtime/plugins/toast.client.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/plugins/toast.client.ts b/src/runtime/plugins/toast.client.ts index c416e6c0bf..caf6ae06cf 100644 --- a/src/runtime/plugins/toast.client.ts +++ b/src/runtime/plugins/toast.client.ts @@ -27,20 +27,20 @@ export default defineNuxtPlugin((nuxtApp) => { nuxtApp.provide('toast', { addNotification, removeNotification, - success ({ title, description }: { title?: string, description?: string } = {}) { + success ({ title, description, timeout = 4000 }: { title?: string, description?: string, timeout?: number } = {}) { addNotification({ type: 'success', title, description, - timeout: 4000 + timeout }) }, - error ({ title = 'An error occurred!', description }: { title?: string, description?: string } = {}) { + error ({ title = 'An error occurred!', description, timeout = 4000 }: { title?: string, description?: string, timeout?: number } = {}) { addNotification({ type: 'error', title, description, - timeout: 4000 + timeout }) } }) From b08874dd9b7a8c6440f5ad8ac439d1dd81fa2cbd Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Wed, 9 Feb 2022 17:13:43 +0100 Subject: [PATCH 2/2] Update toast.client.ts --- src/runtime/plugins/toast.client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/plugins/toast.client.ts b/src/runtime/plugins/toast.client.ts index caf6ae06cf..d19d9133ab 100644 --- a/src/runtime/plugins/toast.client.ts +++ b/src/runtime/plugins/toast.client.ts @@ -27,7 +27,7 @@ export default defineNuxtPlugin((nuxtApp) => { nuxtApp.provide('toast', { addNotification, removeNotification, - success ({ title, description, timeout = 4000 }: { title?: string, description?: string, timeout?: number } = {}) { + success ({ title, description, timeout }: { title?: string, description?: string, timeout?: number } = {}) { addNotification({ type: 'success', title, @@ -35,7 +35,7 @@ export default defineNuxtPlugin((nuxtApp) => { timeout }) }, - error ({ title = 'An error occurred!', description, timeout = 4000 }: { title?: string, description?: string, timeout?: number } = {}) { + error ({ title = 'An error occurred!', description, timeout }: { title?: string, description?: string, timeout?: number } = {}) { addNotification({ type: 'error', title,