discord-jadx/app/src/main/java/com/discord/widgets/settings/profile/SettingsUserProfileViewModel$observeHeaderViewState$1.java
2021-07-19 21:45:22 +02:00

29 lines
2.3 KiB
Java

package com.discord.widgets.settings.profile;
import com.discord.models.domain.ModelUserProfile;
import com.discord.models.user.MeUser;
import com.discord.nullserializable.NullSerializable;
import com.discord.utilities.user.UserUtils;
import com.discord.widgets.settings.profile.SettingsUserProfileViewModel;
import com.discord.widgets.user.profile.UserProfileHeaderViewModel;
import j0.k.b;
import kotlin.NoWhenBranchMatchedException;
/* compiled from: SettingsUserProfileViewModel.kt */
public final class SettingsUserProfileViewModel$observeHeaderViewState$1<T, R> implements b<SettingsUserProfileViewModel.ViewState, UserProfileHeaderViewModel.ViewState> {
public static final SettingsUserProfileViewModel$observeHeaderViewState$1 INSTANCE = new SettingsUserProfileViewModel$observeHeaderViewState$1();
public final UserProfileHeaderViewModel.ViewState call(SettingsUserProfileViewModel.ViewState viewState) {
if (viewState == null) {
return UserProfileHeaderViewModel.ViewState.Uninitialized.INSTANCE;
}
if (viewState instanceof SettingsUserProfileViewModel.ViewState.Loaded) {
SettingsUserProfileViewModel.ViewState.Loaded loaded = (SettingsUserProfileViewModel.ViewState.Loaded) viewState;
MeUser copy$default = loaded.getCurrentAvatar() != null ? MeUser.copy$default(loaded.getUser(), 0, null, loaded.getCurrentAvatar().a(), null, false, false, 0, null, null, false, false, null, 0, 0, null, null, null, null, 262139, null) : loaded.getUser();
ModelUserProfile userProfile = loaded.getUserProfile();
String a = loaded.getCurrentBannerImage() != null ? loaded.getCurrentBannerImage().a() : loaded.getUser().getBanner();
NullSerializable<String> currentBannerColorHex = loaded.getCurrentBannerColorHex();
return new UserProfileHeaderViewModel.ViewState.Loaded(copy$default, a, (!(currentBannerColorHex instanceof NullSerializable.b) && !(currentBannerColorHex instanceof NullSerializable.a)) ? loaded.getUser().getBannerColor() : currentBannerColorHex.a(), null, null, null, userProfile, UserUtils.INSTANCE.isPremium(loaded.getUser()), loaded.getUser().isVerified(), 0, false, false, true, false, false, 26168, null);
}
throw new NoWhenBranchMatchedException();
}
}