66 lines
2.2 KiB
TypeScript
66 lines
2.2 KiB
TypeScript
// Metro module 16258 (f16259).
|
|
import { ADD_AVATAR_MODAL_KEY } from "./components/AddAvatarModalConstants";
|
|
import { AnalyticEvents } from "../../../Constants";
|
|
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
|
|
import { saveProfileAndAccountRequest } from "../../../actions/UserSettingsAccountActionCreators";
|
|
import AlertActionCreators from "../../../actions/AlertActionCreators";
|
|
import { intl, t } from "../../../intl/index.native";
|
|
import { setPendingChanges } from "../../user_profile/UserProfileSettingsActionCreators";
|
|
import { announcePendingAvatarChange } from "../../profile_customization/ProfileCustomizationUtils";
|
|
import ModalActionCreators from "../../../actions/ModalActionCreators";
|
|
import { nextOnboardingStep } from "../../nuf/native/NUFActionCreators";
|
|
export function handlePressNext(a0, a1, a2) {
|
|
if (a0 != null) {
|
|
AnalyticsUtils.track(AnalyticEvents.USER_AVATAR_UPDATED, {
|
|
default_avatar_selected: a1,
|
|
is_guild_profile: false,
|
|
location: {
|
|
page: "Onboarding"
|
|
}
|
|
});
|
|
saveProfileAndAccountRequest({
|
|
avatar: a0.imageUri,
|
|
avatar_description: a0.description
|
|
});
|
|
}
|
|
if (a2 != null) {
|
|
a2();
|
|
} else {
|
|
ModalActionCreators.popWithKey(ADD_AVATAR_MODAL_KEY);
|
|
nextOnboardingStep({
|
|
skip: false
|
|
});
|
|
}
|
|
}
|
|
export function showSkipAvatarModal(c22927_0) {
|
|
AnalyticsUtils.track(AnalyticEvents.NUO_TRANSITION, {
|
|
flow_type: "Mobile NUX Post Reg",
|
|
from_step: "Skip avatar modal",
|
|
skip_attempt: true
|
|
});
|
|
AlertActionCreators.show({
|
|
title: intl.string(t.DnKHuV),
|
|
body: intl.string(t["1EPySE"]),
|
|
cancelText: intl.string(t["7eZ3ji"]),
|
|
confirmText: intl.string(t.nhJ8OC),
|
|
onConfirm: () => {
|
|
setPendingChanges({
|
|
avatar: null
|
|
});
|
|
announcePendingAvatarChange("remove");
|
|
if (c22927_0 != null) {
|
|
c22927_0(true);
|
|
} else {
|
|
ModalActionCreators.popWithKey(ADD_AVATAR_MODAL_KEY);
|
|
nextOnboardingStep({
|
|
skip: true
|
|
});
|
|
}
|
|
},
|
|
hideActionSheet: false
|
|
});
|
|
}
|
|
export function openAddAvatarModal() {
|
|
ModalActionCreators.pushLazy(import("./components/AddAvatarModal"), {}, ADD_AVATAR_MODAL_KEY);
|
|
}
|