Skip to content

Commit

Permalink
chore: add error feedback on config write
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Nov 11, 2024
1 parent 0817865 commit 87afab8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@
"@commitlint/config-conventional"
]
}
}
}
8 changes: 8 additions & 0 deletions static/scripts/render-manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@ export class ManifestRenderer {
private _writeNewConfig(option: "add" | "remove"): void {
const selectedManifest = localStorage.getItem("selectedPluginManifest");
if (!selectedManifest) {
toastNotification("No selected plugin manifest found.", {
type: "error",
shouldAutoDismiss: true,
});
throw new Error("No selected plugin manifest found");
}
const pluginManifest = JSON.parse(selectedManifest) as Manifest;
Expand All @@ -437,6 +441,10 @@ export class ManifestRenderer {
});

if (!pluginUrl) {
toastNotification(`No plugin URL found for ${pluginName}.`, {
type: "error",
shouldAutoDismiss: true,
});
throw new Error("No plugin URL found");
}

Expand Down

0 comments on commit 87afab8

Please sign in to comment.