Skip to content

Commit 3586fb6

Browse files
committed
fix onboarding skip registration avatar issue
1 parent d27f406 commit 3586fb6

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

projects/social_platform/src/app/office/feed/feed.component.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export class FeedComponent implements OnInit, AfterViewInit, OnDestroy {
101101
tap(includes => {
102102
this.includes.set(includes);
103103
}),
104-
skip(1), // Пропускаем первое значение (уже загружено резолвером)
104+
skip(1),
105105
concatMap(includes => {
106106
this.totalItemsCount.set(0);
107107
this.feedPage.set(0);
@@ -112,7 +112,6 @@ export class FeedComponent implements OnInit, AfterViewInit, OnDestroy {
112112
.subscribe(feed => {
113113
this.feedItems.set(feed);
114114

115-
// Плавная прокрутка к началу ленты после фильтрации
116115
setTimeout(() => {
117116
this.feedRoot?.nativeElement.children[0].scrollIntoView({ behavior: "smooth" });
118117
});
@@ -175,7 +174,6 @@ export class FeedComponent implements OnInit, AfterViewInit, OnDestroy {
175174

176175
// Определяем тип новости по структуре contentObject
177176
if ("email" in item.content.contentObject) {
178-
// Новость профиля
179177
this.profileNewsService
180178
.toggleLike(
181179
item.content.contentObject.id as unknown as string,
@@ -195,7 +193,6 @@ export class FeedComponent implements OnInit, AfterViewInit, OnDestroy {
195193
});
196194
});
197195
} else if ("leader" in item.content.contentObject) {
198-
// Новость проекта
199196
this.projectNewsService
200197
.toggleLike(
201198
item.content.contentObject.id as unknown as string,

projects/social_platform/src/app/office/onboarding/stage-zero/stage-zero.component.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,23 @@ export class OnboardingStageZeroComponent implements OnInit, OnDestroy {
757757
return;
758758
}
759759

760-
this.completeRegistration(3);
760+
const onboardingSkipInfo = {
761+
avatar: this.stageForm.get("avatar")?.value,
762+
city: this.stageForm.get("city")?.value,
763+
};
764+
765+
this.skipSubmitting.set(true);
766+
this.authService
767+
.saveProfile(onboardingSkipInfo)
768+
.pipe(concatMap(() => this.authService.setOnboardingStage(3)))
769+
.subscribe({
770+
next: () => this.completeRegistration(3),
771+
error: error => {
772+
this.skipSubmitting.set(false);
773+
this.isModalErrorYear.set(true);
774+
this.isModalErrorYearText.set(error.error?.message || "Ошибка сохранения");
775+
},
776+
});
761777
}
762778

763779
onSubmit(): void {

0 commit comments

Comments
 (0)