mirror of
https://github.com/ivabus/gui
synced 2025-04-23 14:07:14 +03:00
Unsubscribe to package topic (#634)
* bump 0.3.0 * bump v0.2.20 * #451 unsubscribe to package topic on uninstall * cleanup
This commit is contained in:
parent
0d9ac5e30e
commit
7c63a1f570
1 changed files with 5 additions and 0 deletions
|
@ -20,6 +20,7 @@ import { getAutoUpdateStatus, getUpdater, isDev } from "./auto-updater";
|
|||
import { loadPackageCache, writePackageCache } from "./package";
|
||||
import { nanoid } from "nanoid";
|
||||
import { MainWindowNotifier } from "./types";
|
||||
import { unsubscribeToPackageTopic } from "./push-notification";
|
||||
|
||||
export type HandlerOptions = {
|
||||
// A function to call back to the current main
|
||||
|
@ -160,6 +161,10 @@ export default function initializeHandlers({ notifyMainWindow }: HandlerOptions)
|
|||
try {
|
||||
log.info("deleting package:", fullName);
|
||||
await deletePackageFolder(fullName, version);
|
||||
const { installed_versions } = await getInstalledVersionsForPackage(fullName);
|
||||
if (installed_versions.length === 0) {
|
||||
await unsubscribeToPackageTopic(fullName);
|
||||
}
|
||||
} catch (e) {
|
||||
log.error(e);
|
||||
} finally {
|
||||
|
|
Loading…
Reference in a new issue