Skip to content

Commit

Permalink
chore: remove duplicate push notifcation
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Nov 30, 2024
1 parent 6b43d6d commit f9de8b7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions static/scripts/rendering/write-add-remove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,22 @@ export function writeNewConfig(renderer: ManifestRenderer, option: "add" | "remo
],
};

removePushNotificationIfPresent();

if (option === "add") {
handleAddPlugin(renderer, plugin, pluginManifest);
} else if (option === "remove") {
handleRemovePlugin(renderer, plugin, pluginManifest);
}
}

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?`, {
Expand Down

0 comments on commit f9de8b7

Please sign in to comment.