8000 refactor(extensions/podman): handle notifications in specific class · podman-desktop/podman-desktop@c5d7df1 · GitHub
[go: up one dir, main page]

Skip to content

Commit c5d7df1

Browse files
committed
refactor(extensions/podman): handle notifications in specific class
Signed-off-by: Simon Rey <sfbrey+eqqe@gmail.com>
1 parent 80e581d commit c5d7df1

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

extensions/podman/packages/extension/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ export async function doMonitorProvider(provider: extensionApi.Provider): Promis
709709
// if podman is not installed and the OS is linux we show the podman onboarding notification (if it has not been shown earlier)
710710
// this should be limited to Linux as in other OSes the onboarding workflow is enabled based on the podman machine existance
711711
// and the notification is handled by checking the machine
712-
if (extensionApi.env.isLinux && extensionNotifications.shouldNotifySetup) {
712+
if (extensionApi.env.isLinux) {
713713
// push setup notification
714714
extensionNotifications.notifySetupPodman();
715715
}

extensions/podman/packages/extension/src/utils/notifications.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,18 @@ export class ExtensionNotifications {
7171
// to avoid having multiple notification of the same nature in the notifications list
7272
// we first dispose the old one and then push the same again
7373
public notifySetupPodman(): void {
74-
// Alert for setting up
75-
this._notificationDisposable ??= extensionApi.window.showNotification({
76-
title: 'Podman needs to be set up',
77-
body: 'The Podman extension is installed, yet requires configuration. Some features might not function optimally.',
78-
type: 'info',
79-
markdownActions: ':button[Set up]{href=/preferences/onboarding/podman-desktop.podman title="Set up Podman"}',
80-
highlight: true,
81-
silent: true,
82-
});
83-
this.shouldNotifySetup = false;
74+
if (this.shouldNotifySetup) {
75+
// Alert for setting up
76+
this._notificationDisposable ??= extensionApi.window.showNotification({
77+
title: 'Podman needs to be set up',
78+
body: 'The Podman extension is installed, yet requires configuration. Some features might not function optimally.',
79+
type: 'info',
80+
markdownActions: ':button[Set up]{href=/preferences/onboarding/podman-desktop.podman title="Set up Podman"}',
81+
highlight: true,
82+
silent: true,
83+
});
84+
this.shouldNotifySetup = false;
85+
}
8486
}
8587

8688
private notifyDisguisedPodmanSocket(): void {
@@ -176,7 +178,7 @@ export class ExtensionNotifications {
176178
public notifySetupPodmanNotLinux(): void {
177179
// Only show the notification on macOS and Windows
178180
// as Podman is already installed on Linux and machine is OPTIONAL.
179-
if (this.shouldNotifySetup && !extensionApi.env.isLinux) {
181+
if (!extensionApi.env.isLinux) {
180182
// push setup notification
181183
this.notifySetupPodman();
182184
}

0 commit comments

Comments
 (0)
0