1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Remove resetting state for update is ready to be installed for being unclear

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2022-05-09 12:52:21 +03:00
parent c631547a04
commit 941f15b9f9
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A

View File

@ -14,23 +14,18 @@ const syncUpdateIsReadyToBeInstalledInjectable = getInjectable({
const electronUpdater = di.inject(electronUpdaterInjectable);
const updateIsReadyToBeInstalledState = di.inject(updateIsReadyToBeInstalledStateInjectable);
const makeUpdateReadyToBeInstalledFor = (available: boolean) => () => {
updateIsReadyToBeInstalledState.set(available);
};
return getStartableStoppable(
"synchronize-update-is-available-state",
() => {
const makeUpdateReadyToBeInstalled = makeUpdateReadyToBeInstalledFor(true);
const makeUpdateUnavailable = makeUpdateReadyToBeInstalledFor(false);
const makeUpdateReadyToBeInstalled = () => {
updateIsReadyToBeInstalledState.set(true);
};
electronUpdater.on("update-downloaded", makeUpdateReadyToBeInstalled);
electronUpdater.on("update-not-available", makeUpdateUnavailable);
return () => {
electronUpdater.off("update-downloaded", makeUpdateReadyToBeInstalled);
electronUpdater.off("update-not-available", makeUpdateUnavailable);
};
},
);