@samitouri / QOSami-HFS / commits / f29a05fa

fix: console error "miss" downloading a plugin that was previously enabled

Massimo Melina committed Oct 12, 2024 at 14:04 UTC f29a05fa33c75e39c1306074699d96213b5ad726
1 file changed +2 -1
src/github.ts
+2 -1
@@ -110,7 +110,8 @@ export async function downloadPlugin(repo: Repo, { branch='', overwrite=false }=
110 await rename(tempInstallPath, installPath)
111 .catch(e => { throw e.code !== 'ENOENT' ? e : new ApiError(HTTP_NOT_ACCEPTABLE, "missing main file") })
112 if (wasEnabled)
113 - void startPlugin(folder) // don't wait, in case it fails to start
113 + void startPlugin(folder) // don't wait, in case it fails to start. We still use startPlugin instead of enablePlugin, as it will take care of disabling other themes.
114 + .catch(() => {}) // it will possibly fail (with 'miss') because the plugin has probably not been loaded yet.
115 events.emit('pluginDownloaded', { id: folder, repo })
116 return folder
117 }