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

showMessagePopup for menu and tray

Signed-off-by: Gabriel <gaccettola@mirantis.com>
This commit is contained in:
Gabriel 2023-03-14 22:58:49 +01:00
parent 470de1c5b2
commit 67fe53e023
2 changed files with 22 additions and 10 deletions

View File

@ -9,7 +9,7 @@ import processCheckingForUpdatesInjectable from "../../../main/process-checking-
import showApplicationWindowInjectable from "../../../../../main/start-main-application/lens-window/show-application-window.injectable";
import updatingIsEnabledInjectable from "../../../main/updating-is-enabled/updating-is-enabled.injectable";
import isMacInjectable from "../../../../../common/vars/is-mac.injectable";
// import showSuccessNotificationInjectable from "../../../../../renderer/components/notifications/show-success-notification.injectable";
import showMessagePopupInjectable from "../../../../../main/electron-app/features/show-message-popup.injectable";
const checkForUpdatesMenuItemInjectable = getInjectable({
id: "check-for-updates-menu-item",
@ -19,7 +19,7 @@ const checkForUpdatesMenuItemInjectable = getInjectable({
const showApplicationWindow = di.inject(showApplicationWindowInjectable);
const updatingIsEnabled = di.inject(updatingIsEnabledInjectable);
const isMac = di.inject(isMacInjectable);
// const showSuccessNotification = di.inject(showSuccessNotificationInjectable);
const showMessagePopup = di.inject(showMessagePopupInjectable);
return {
kind: "clickable-menu-item" as const,
@ -35,9 +35,15 @@ const checkForUpdatesMenuItemInjectable = getInjectable({
if (updateIsReadyToBeInstalled) {
await showApplicationWindow();
} else {
// showSuccessNotification(
// `You're all good\n\nYou've got the latest version of Lens\nthanks for staying on the ball.`,
// );
showMessagePopup(
`title`,
'productName',
'message',
{
textWidth: 300
},
);
}
},
};

View File

@ -16,7 +16,7 @@ import processCheckingForUpdatesInjectable from "../../../../main/process-checki
import { withErrorSuppression } from "../../../../../../common/utils/with-error-suppression/with-error-suppression";
import { pipeline } from "@ogre-tools/fp";
import withErrorLoggingInjectable from "../../../../../../common/utils/with-error-logging/with-error-logging.injectable";
// import showSuccessNotificationInjectable from "../../../../../../renderer/components/notifications/show-success-notification.injectable";
import showMessagePopupInjectable from "../../../../../../main/electron-app/features/show-message-popup.injectable";
const checkForUpdatesTrayItemInjectable = getInjectable({
id: "check-for-updates-tray-item",
@ -30,7 +30,7 @@ const checkForUpdatesTrayItemInjectable = getInjectable({
const checkingForUpdatesState = di.inject(updatesAreBeingDiscoveredInjectable);
const processCheckingForUpdates = di.inject(processCheckingForUpdatesInjectable);
const withErrorLoggingFor = di.inject(withErrorLoggingInjectable);
// const showSuccessNotification = di.inject(showSuccessNotificationInjectable);
const showMessagePopup = di.inject(showMessagePopupInjectable);
return {
id: "check-for-updates",
@ -66,9 +66,15 @@ const checkForUpdatesTrayItemInjectable = getInjectable({
if (updateIsReadyToBeInstalled) {
await showApplicationWindow();
} else {
// showSuccessNotification(
// `You're all good\n\nYou've got the latest version of Lens\nthanks for staying on the ball.`,
// );
showMessagePopup(
`title`,
'productName',
'message',
{
textWidth: 300
},
);
}
},