diff --git a/static/scripts/rendering/write-add-remove.ts b/static/scripts/rendering/write-add-remove.ts index 6ada9ec..7c0d4cc 100644 --- a/static/scripts/rendering/write-add-remove.ts +++ b/static/scripts/rendering/write-add-remove.ts @@ -69,6 +69,8 @@ export function writeNewConfig(renderer: ManifestRenderer, option: "add" | "remo ], }; + removePushNotificationIfPresent(); + if (option === "add") { handleAddPlugin(renderer, plugin, pluginManifest); } else if (option === "remove") { @@ -76,6 +78,13 @@ export function writeNewConfig(renderer: ManifestRenderer, option: "add" | "remo } } +function removePushNotificationIfPresent() { + const notification = document.querySelector(".toast.toast-success.show"); + if (notification) { + notification.remove(); + } +} + function handleAddPlugin(renderer: ManifestRenderer, plugin: Plugin, pluginManifest: Manifest): void { renderer.configParser.addPlugin(plugin); toastNotification(`Configuration for ${pluginManifest.name} saved successfully. Do you want to push to GitHub?`, {