diff --git a/packages/builder/src/App.svelte b/packages/builder/src/App.svelte index 76ef32a669..d10c04727f 100644 --- a/packages/builder/src/App.svelte +++ b/packages/builder/src/App.svelte @@ -4,11 +4,10 @@ import { Router, basepath } from "@sveltech/routify" import { routes } from "../routify/routes" import { store, initialise } from "builderStore" - import NotificationDisplay from "components/common/Notification/NotificationDisplay.svelte"; + import NotificationDisplay from "components/common/Notification/NotificationDisplay.svelte" $basepath = "/_builder" - diff --git a/packages/builder/src/builderStore/store/notifications.js b/packages/builder/src/builderStore/store/notifications.js index 201e13e4b9..85e708e92a 100644 --- a/packages/builder/src/builderStore/store/notifications.js +++ b/packages/builder/src/builderStore/store/notifications.js @@ -1,13 +1,16 @@ -import { writable } from 'svelte/store' +import { writable } from "svelte/store" import { generate } from "shortid" export const notificationStore = writable({ - notifications: [] + notifications: [], }) -export function send(message, type = 'default') { +export function send(message, type = "default") { notificationStore.update(state => { - state.notifications = [...state.notifications, { id: generate(), type, message }] + state.notifications = [ + ...state.notifications, + { id: generate(), type, message }, + ] return state }) } @@ -16,5 +19,5 @@ export const notifier = { danger: msg => send(msg, "danger"), warning: msg => send(msg, "warning"), info: msg => send(msg, "info"), - success: msg => send(msg, "success") -} \ No newline at end of file + success: msg => send(msg, "success"), +} diff --git a/packages/builder/src/components/common/Notification/NotificationDisplay.svelte b/packages/builder/src/components/common/Notification/NotificationDisplay.svelte index cfd39ad068..4abcffef57 100644 --- a/packages/builder/src/components/common/Notification/NotificationDisplay.svelte +++ b/packages/builder/src/components/common/Notification/NotificationDisplay.svelte @@ -16,17 +16,20 @@ $: if ($notificationStore.notifications.length) { setTimeout(() => { notificationStore.update(state => { - state.notifications.shift(); + state.notifications.shift() state.notifications = state.notifications - return state; + return state }) }, timeout) - } + }