mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
removed update broadcasting/listening, updated snapshots
Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
1 parent
041141fe39
commit
19259bf537
30 files changed
+1355
-231
No files matched your search
@@ -1,62 +0,0 @@
|
||||
/**
|
||||
* 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 { ApplicationUpdateStatusChannel, ApplicationUpdateStatusEventId } from "../../common/application-update/application-update-status-channel.injectable";
|
||||
import applicationUpdateStatusChannelInjectable from "../../common/application-update/application-update-status-channel.injectable";
|
||||
//import showInfoNotificationInjectable from "../components/notifications/show-info-notification.injectable";
|
||||
import type { MessageChannelListener } from "../../common/utils/channel/message-channel-listener-injection-token";
|
||||
import { messageChannelListenerInjectionToken } from "../../common/utils/channel/message-channel-listener-injection-token";
|
||||
|
||||
const applicationUpdateStatusListenerInjectable = getInjectable({
|
||||
id: "application-update-status-listener",
|
||||
|
||||
instantiate: (di): MessageChannelListener<ApplicationUpdateStatusChannel> => {
|
||||
const channel = di.inject(applicationUpdateStatusChannelInjectable);
|
||||
//const showInfoNotification = di.inject(showInfoNotificationInjectable);
|
||||
|
||||
const eventHandlers: Record<ApplicationUpdateStatusEventId, { handle: (version?: string) => void }> = {
|
||||
"checking-for-updates": {
|
||||
handle: () => {
|
||||
//showInfoNotification("Checking for updates...");
|
||||
},
|
||||
},
|
||||
|
||||
"no-updates-available": {
|
||||
handle: () => {
|
||||
//showInfoNotification("No new updates available");
|
||||
},
|
||||
},
|
||||
|
||||
"download-for-update-started": {
|
||||
handle: (/*version*/) => {
|
||||
//showInfoNotification(`Download for version ${version} started...`);
|
||||
},
|
||||
},
|
||||
|
||||
"download-for-update-failed": {
|
||||
handle: () => {
|
||||
//showInfoNotification("Download of update failed");
|
||||
},
|
||||
},
|
||||
|
||||
"download-for-update-succeeded": {
|
||||
handle: () => {
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
return {
|
||||
channel,
|
||||
|
||||
handler: ({ eventId, version }) => {
|
||||
eventHandlers[eventId].handle(version);
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: messageChannelListenerInjectionToken,
|
||||
});
|
||||
|
||||
export default applicationUpdateStatusListenerInjectable;
|
||||
@@ -72,6 +72,7 @@ const downloadSucceeded = (version: string) => <div>{`Download for version ${ver
|
||||
|
||||
const idle = () => <></>;
|
||||
|
||||
|
||||
export const NonInjectedAutoUpdateComponent = observer(({ progressOfUpdateDownload, discoveredVersionState, downloadingUpdateState, checkingForUpdatesState }: Dependencies) => {
|
||||
const discoveredVersion = discoveredVersionState.value.get();
|
||||
|
||||
|
||||
Reference in new issue
Block a user