Skip to content

Commit e86aa47

Browse files
committed
fix: extension calls subs activation and registry configuration twice
This is happens after installing and removing extension during the same podman desktop session Signed-off-by: Denis Golovin <[email protected]>
1 parent 6dc3a66 commit e86aa47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/extension.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ export async function activate(extensionContext: extensionApi.ExtensionContext):
246246
},
247247
);
248248

249-
extensionApi.authentication.onDidChangeSessions(async (e) => {
249+
const onDidChangeSessionDisposable = extensionApi.authentication.onDidChangeSessions(async (e) => {
250250
if(e.provider.id === 'redhat.authentication-provider') {
251251
const newSession = await signIntoRedHatDeveloperAccount(false);
252252
if (!currentSession && newSession) {
@@ -320,7 +320,7 @@ export async function activate(extensionContext: extensionApi.ExtensionContext):
320320
);
321321
});
322322

323-
extensionContext.subscriptions.push(SignInCommand, SignOutCommand, SignUpCommand);
323+
extensionContext.subscriptions.push(SignInCommand, SignOutCommand, SignUpCommand, onDidChangeSessionDisposable);
324324
}
325325

326326
export function deactivate(): void {

0 commit comments

Comments
 (0)