Implement naive notifications for version updates

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

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne SavolainenandMikko Aspiala committed 2022-06-03 07:47:28 +03:00
1 parent 5fbe28b363
commit 77232084d1
8 files changed
+50 -4

No files matched your search

@@ -0,0 +1,26 @@
/**
* 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 { ipcChannelListenerInjectionToken } from "../../ipc-channel-listeners/ipc-channel-listener-injection-token";
import { notificationChannel } from "../../../common/notification/notification-channel";
import { Notifications } from "./index";
const notificationListenerInjectable = getInjectable({
id: "notification-listener",
instantiate: () => ({
channel: notificationChannel,
handle: (message: string) => {
Notifications.shortInfo(message);
},
}),
causesSideEffects: true,
injectionToken: ipcChannelListenerInjectionToken,
});
export default notificationListenerInjectable;
+4
View File
@@ -44,6 +44,8 @@ import setupOnApiErrorListenersInjectable from "./api/setup-on-api-errors.inject
import { observable } from "mobx";
import defaultShellInjectable from "./components/+preferences/default-shell.injectable";
import themeStoreInjectable from "./themes/store.injectable";
import notificationListenerInjectable from "./components/notifications/notification-listener.injectable";
import { notificationChannel } from "../common/notification/notification-channel";
export const getDiForUnitTesting = (opts: GetDiForUnitTestingOptions = {}) => {
const {
@@ -120,6 +122,8 @@ export const getDiForUnitTesting = (opts: GetDiForUnitTestingOptions = {}) => {
di.override(getValueFromRegisteredChannelInjectable, () => () => Promise.resolve(undefined as never));
di.override(registerIpcChannelListenerInjectable, () => () => undefined);
di.override(notificationListenerInjectable, () => ({ channel: notificationChannel, handle: () => {} }));
overrideFsWithFakes(di);
di.override(focusWindowInjectable, () => () => {});
@@ -5,7 +5,6 @@
import { getInjectionToken } from "@ogre-tools/injectable";
import type { Channel } from "../../common/ipc-channel/channel";
export interface IpcChannelListener {
channel: Channel<unknown>;
handle: (value: any) => void;