Synchronize initial values of sync boxes when window starts

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen committed 2022-06-03 07:48:05 +03:00
1 parent 427cde4755
commit 620cc68071
11 files changed
+213 -37

No files matched your search

@@ -13,7 +13,7 @@ export type ApplicationUpdateStatusEventId =
| "download-for-update-failed";
export interface ApplicationUpdateStatusChannelMessage { eventId: ApplicationUpdateStatusEventId; version?: string }
export type ApplicationUpdateStatusChannel = Channel<ApplicationUpdateStatusChannelMessage>;
export type ApplicationUpdateStatusChannel = Channel<ApplicationUpdateStatusChannelMessage, never>;
const applicationUpdateStatusChannelInjectable = getInjectable({
id: "application-update-status-channel",
@@ -5,6 +5,7 @@
import { getInjectable } from "@ogre-tools/injectable";
import createSyncBoxInjectable from "../../sync-box/create-sync-box.injectable";
import type { UpdateChannel } from "../update-channels";
import { syncBoxInjectionToken } from "../../sync-box/sync-box-injection-token";
const discoveredUpdateVersionInjectable = getInjectable({
id: "discovered-update-version",
@@ -16,6 +17,8 @@ const discoveredUpdateVersionInjectable = getInjectable({
"discovered-update-version",
);
},
injectionToken: syncBoxInjectionToken,
});
export default discoveredUpdateVersionInjectable;
@@ -4,6 +4,7 @@
*/
import { getInjectable } from "@ogre-tools/injectable";
import createSyncBoxInjectable from "../../sync-box/create-sync-box.injectable";
import { syncBoxInjectionToken } from "../../sync-box/sync-box-injection-token";
const progressOfUpdateDownloadInjectable = getInjectable({
id: "progress-of-update-download-state",
@@ -13,6 +14,8 @@ const progressOfUpdateDownloadInjectable = getInjectable({
return createSyncBox<number>("progress-of-update-download");
},
injectionToken: syncBoxInjectionToken,
});
export default progressOfUpdateDownloadInjectable;
@@ -4,6 +4,7 @@
*/
import { getInjectable } from "@ogre-tools/injectable";
import createSyncBoxInjectable from "../../sync-box/create-sync-box.injectable";
import { syncBoxInjectionToken } from "../../sync-box/sync-box-injection-token";
const updateIsBeingDownloadedInjectable = getInjectable({
id: "update-is-being-downloaded",
@@ -13,6 +14,8 @@ const updateIsBeingDownloadedInjectable = getInjectable({
return createSyncBox<boolean>("update-is-being-downloaded");
},
injectionToken: syncBoxInjectionToken,
});
export default updateIsBeingDownloadedInjectable;
@@ -4,6 +4,7 @@
*/
import { getInjectable } from "@ogre-tools/injectable";
import createSyncBoxInjectable from "../../sync-box/create-sync-box.injectable";
import { syncBoxInjectionToken } from "../../sync-box/sync-box-injection-token";
const updatesAreBeingDiscoveredInjectable = getInjectable({
id: "updates-are-being-discovered",
@@ -13,6 +14,8 @@ const updatesAreBeingDiscoveredInjectable = getInjectable({
return createSyncBox<boolean>("updates-are-being-discovered");
},
injectionToken: syncBoxInjectionToken,
});
export default updatesAreBeingDiscoveredInjectable;