mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add notifications about change in update status
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
1 parent
f9095a90b6
commit
84ae8a399b
11 files changed
+147
-80
No files matched your search
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { Channel } from "../channel/channel-injection-token";
|
||||
import { channelInjectionToken } from "../channel/channel-injection-token";
|
||||
|
||||
export type ApplicationUpdateStatusEventId =
|
||||
| "checking-for-updates"
|
||||
| "no-updates-available"
|
||||
| "download-for-update-started"
|
||||
| "download-for-update-failed";
|
||||
|
||||
export type ApplicationUpdateStatusChannel = Channel<{ eventId: ApplicationUpdateStatusEventId; version?: string }>;
|
||||
|
||||
const applicationUpdateStatusChannelInjectable = getInjectable({
|
||||
id: "application-update-status-channel",
|
||||
|
||||
instantiate: (): ApplicationUpdateStatusChannel => ({
|
||||
id: "application-update-status-channel",
|
||||
}),
|
||||
|
||||
injectionToken: channelInjectionToken,
|
||||
});
|
||||
|
||||
export default applicationUpdateStatusChannelInjectable;
|
||||
+1
-1
@@ -12,7 +12,7 @@ const discoveredUpdateVersionInjectable = getInjectable({
|
||||
instantiate: (di) => {
|
||||
const createSyncBox = di.inject(createSyncBoxInjectable);
|
||||
|
||||
return createSyncBox<{ version: string; updateChannel: UpdateChannel }>(
|
||||
return createSyncBox<{ version: string; updateChannel: UpdateChannel } | null>(
|
||||
"discovered-update-version",
|
||||
);
|
||||
},
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { createChannel } from "../ipc-channel/create-channel/create-channel";
|
||||
|
||||
export const notificationChannel = createChannel<string>("notification:message");
|
||||
Reference in new issue
Block a user