Skip to content

Commit

Permalink
Remove subscription and type introspection
Browse files Browse the repository at this point in the history
  • Loading branch information
taldekar committed Jan 24, 2025
1 parent 887946d commit db7e4a8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.services.ISourceProviderService;

import io.reactivex.rxjava3.disposables.Disposable;
import software.aws.toolkits.eclipse.amazonq.broker.api.EventObserver;
import software.aws.toolkits.eclipse.amazonq.broker.api.Subscription;
import software.aws.toolkits.eclipse.amazonq.lsp.auth.model.AuthState;
import software.aws.toolkits.eclipse.amazonq.plugin.Activator;

Expand All @@ -35,10 +35,10 @@
public final class AuthSourceProvider extends AbstractSourceProvider implements EventObserver<AuthState> {
public static final String IS_LOGGED_IN_VARIABLE_ID = "is_logged_in";
private boolean isLoggedIn = false;
private Subscription authStateSubscription;
private Disposable authStateSubscription;

public AuthSourceProvider() {
authStateSubscription = Activator.getEventBroker().subscribe(this);
authStateSubscription = Activator.getEventBroker().subscribe(AuthState.class, this);
isLoggedIn = Activator.getLoginService().getAuthState().isLoggedIn();
}

Expand All @@ -57,7 +57,7 @@ public void dispose() {
// Notify listeners that this provider is being disposed
fireSourceChanged(ISources.WORKBENCH, IS_LOGGED_IN_VARIABLE_ID, null);

authStateSubscription.cancel();
authStateSubscription.dispose();
}

@Override
Expand Down

0 comments on commit db7e4a8

Please sign in to comment.