From f9de8b7dff2ca3c281ecbfd0b8344511e986f328 Mon Sep 17 00:00:00 2001 From: Keyrxng <106303466+Keyrxng@users.noreply.github.com> Date: Sat, 30 Nov 2024 00:38:58 +0000 Subject: [PATCH] chore: remove duplicate push notifcation --- static/scripts/rendering/write-add-remove.ts | 9 +++++++++ 1 file changed, 9 insertions(+) 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?`, {