use of org.stepik.core.metrics.MetricsStatus.SUCCESSFUL in project intellij-plugins by StepicOrg.
the class StepikAuthManager method setState.
private static void setState(@NotNull StepikAuthState value) {
StepikAuthState oldState = state;
state = value;
if (state == NOT_AUTH) {
stepikApiClient.setTokenInfo(null);
user = null;
long userId = getLastUser();
setTokenInfo(userId, new TokenInfo());
setLastUser(0);
}
if (oldState != state) {
if (state == AUTH) {
Metrics.authenticate(SUCCESSFUL);
}
executor.execute(() -> listeners.forEach(listener -> listener.stateChanged(oldState, state)));
}
}
Aggregations