Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: update install button when plugin is installed #1216

Merged
merged 3 commits into from
Mar 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/sidebarApps/extensions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,20 @@ function ListItem({ icon, name, id, version, downloads, installed, source }) {

const { default: installPlugin } = await import("lib/installPlugin");
await installPlugin(id, remotePlugin.name, purchaseToken);
const searchInput = container.querySelector('input[name="search-ext"]');
if (searchInput) {
searchInput.value = "";
$searchResult.content = "";
updateHeight($searchResult);
$installed.expand();
}
window.toast(strings["success"], 3000);
$explore.ontoggle();
if (!$explore.collapsed) {
$explore.ontoggle();
}
if (!$installed.collapsed) {
$installed.ontoggle();
}
} catch (err) {
console.error(err);
window.toast(helpers.errorMessage(err), 3000);
Expand Down Expand Up @@ -521,6 +533,13 @@ async function uninstall(id) {
]);
acode.unmountPlugin(id);

const searchInput = container.querySelector('input[name="search-ext"]');
if (searchInput) {
searchInput.value = "";
$searchResult.content = "";
updateHeight($searchResult);
}

// Show Ad If Its Free Version, interstitial Ad(iad) is loaded.
if (IS_FREE_VERSION && (await window.iad?.isLoaded())) {
window.iad.show();
Expand Down