Cleaned code
This commit is contained in:
@@ -5,6 +5,7 @@ import {addIcons} from "ionicons";
|
|||||||
import {sendOutline} from 'ionicons/icons';
|
import {sendOutline} from 'ionicons/icons';
|
||||||
import {GetGroupDetailsDto, MessagesService} from "../../services/api";
|
import {GetGroupDetailsDto, MessagesService} from "../../services/api";
|
||||||
import {firstValueFrom} from "rxjs";
|
import {firstValueFrom} from "rxjs";
|
||||||
|
|
||||||
addIcons({
|
addIcons({
|
||||||
"send-outline": sendOutline
|
"send-outline": sendOutline
|
||||||
})
|
})
|
||||||
@@ -51,8 +52,7 @@ export class MessageFormComponent {
|
|||||||
try {
|
try {
|
||||||
await firstValueFrom(this.messagesService.sendMessageEndpoint(this.groupId(), this.messageForm.getRawValue()));
|
await firstValueFrom(this.messagesService.sendMessageEndpoint(this.groupId(), this.messageForm.getRawValue()));
|
||||||
this.messageForm.reset();
|
this.messageForm.reset();
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
const toast = await this.toastCtrl.create({
|
const toast = await this.toastCtrl.create({
|
||||||
message: 'Impossible d\'envoyer le messages.',
|
message: 'Impossible d\'envoyer le messages.',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
|
|||||||
@@ -43,8 +43,7 @@ export class MessageComponent implements OnInit, OnDestroy {
|
|||||||
const messages = await firstValueFrom(this.messagesService.getMessagesEndpoint(this.groupId()));
|
const messages = await firstValueFrom(this.messagesService.getMessagesEndpoint(this.groupId()));
|
||||||
this.chatService.setMessages(messages);
|
this.chatService.setMessages(messages);
|
||||||
await this.chatService.connect(this.groupId());
|
await this.chatService.connect(this.groupId());
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
const toast = await this.toastCtrl.create({
|
const toast = await this.toastCtrl.create({
|
||||||
message: 'Impossible de charger les messages.',
|
message: 'Impossible de charger les messages.',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ import {personOutline, addOutline, settingsOutline, informationCircleOutline} fr
|
|||||||
import {TitlePartComponent} from "../../components/title-part/title-part.component";
|
import {TitlePartComponent} from "../../components/title-part/title-part.component";
|
||||||
import {ChallengeCardComponent} from "../../components/challenge-card/challenge-card.component";
|
import {ChallengeCardComponent} from "../../components/challenge-card/challenge-card.component";
|
||||||
import {
|
import {
|
||||||
AchievementsService, CreateGroupDto,
|
AchievementsService, GetAchievementDto, GetGroupDetailsDto, GetGroupDto,
|
||||||
GetAchievementDto, GetGroupDetailsDto, GetGroupDto,
|
|
||||||
GetRandomChallengeDto,
|
GetRandomChallengeDto,
|
||||||
GetUserChallengeDto,
|
GetUserChallengeDto,
|
||||||
GetUserDetailsDto, GroupsService,
|
GetUserDetailsDto, GroupsService,
|
||||||
@@ -29,7 +28,6 @@ import {GroupsComponent} from "../../components/groups/groups.component";
|
|||||||
import {GroupFormComponent} from "../../components/group-form/group-form.component";
|
import {GroupFormComponent} from "../../components/group-form/group-form.component";
|
||||||
import {GroupInfoComponent} from "../../components/group-info/group-info.component";
|
import {GroupInfoComponent} from "../../components/group-info/group-info.component";
|
||||||
import {MessageComponent} from "../../components/message/message.component";
|
import {MessageComponent} from "../../components/message/message.component";
|
||||||
import {MessageFormComponent} from "../../components/message-form/message-form.component";
|
|
||||||
|
|
||||||
addIcons({
|
addIcons({
|
||||||
'profile': personOutline,
|
'profile': personOutline,
|
||||||
@@ -62,7 +60,6 @@ type View = 'menu' | 'profile' | 'password' | 'designation' | 'gallery' | 'group
|
|||||||
GroupFormComponent,
|
GroupFormComponent,
|
||||||
GroupInfoComponent,
|
GroupInfoComponent,
|
||||||
MessageComponent,
|
MessageComponent,
|
||||||
MessageFormComponent,
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class HomeComponent implements OnInit {
|
export class HomeComponent implements OnInit {
|
||||||
|
|||||||
Reference in New Issue
Block a user