feat(marketplace): enhance install logic with download tracking and installation checks

This commit is contained in:
alexsparkes
2026-02-02 13:29:26 +00:00
parent 333a070020
commit 3fc5d736c8
2 changed files with 30 additions and 2 deletions

View File

@@ -10,6 +10,10 @@ export const useMarketplaceInstall = () => {
const controllerRef = useRef(new AbortController());
const installItem = (type, data) => {
// Check if item is already installed before calling install
const installed = JSON.parse(localStorage.getItem('installed') || '[]');
const isNewInstall = !installed.some((item) => item.id === data.id || item.name === data.name);
install(type, data);
toast(variables.getMessage('toasts.installed'));
variables.stats.postEvent('marketplace-item', `${data.display_name || data.name} installed`);