Skip to content

Commit 9ebd7dd

Browse files
authored
feat: update install button when plugin is installed (#1216)
* feat: update install button when plugin is installed
1 parent 2d179cf commit 9ebd7dd

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/sidebarApps/extensions/index.js

+20-1
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,20 @@ function ListItem({ icon, name, id, version, downloads, installed, source }) {
455455

456456
const { default: installPlugin } = await import("lib/installPlugin");
457457
await installPlugin(id, remotePlugin.name, purchaseToken);
458+
const searchInput = container.querySelector('input[name="search-ext"]');
459+
if (searchInput) {
460+
searchInput.value = "";
461+
$searchResult.content = "";
462+
updateHeight($searchResult);
463+
$installed.expand();
464+
}
458465
window.toast(strings["success"], 3000);
459-
$explore.ontoggle();
466+
if (!$explore.collapsed) {
467+
$explore.ontoggle();
468+
}
469+
if (!$installed.collapsed) {
470+
$installed.ontoggle();
471+
}
460472
} catch (err) {
461473
console.error(err);
462474
window.toast(helpers.errorMessage(err), 3000);
@@ -521,6 +533,13 @@ async function uninstall(id) {
521533
]);
522534
acode.unmountPlugin(id);
523535

536+
const searchInput = container.querySelector('input[name="search-ext"]');
537+
if (searchInput) {
538+
searchInput.value = "";
539+
$searchResult.content = "";
540+
updateHeight($searchResult);
541+
}
542+
524543
// Show Ad If Its Free Version, interstitial Ad(iad) is loaded.
525544
if (IS_FREE_VERSION && (await window.iad?.isLoaded())) {
526545
window.iad.show();

0 commit comments

Comments
 (0)