Cleaned code
This commit is contained in:
@@ -113,8 +113,8 @@ export class GroupInfoComponent implements OnInit {
|
||||
const oldGroup = this.group().id;
|
||||
|
||||
try {
|
||||
await firstValueFrom(this.groupsService.deleteGroupEndpoint(oldGroup));
|
||||
this.idGroup.emit(oldGroup);
|
||||
await firstValueFrom(this.groupsService.deleteGroupEndpoint(oldGroup));
|
||||
this.idGroup.emit(oldGroup);
|
||||
const toast = await this.toastCtrl.create({
|
||||
message: 'Groupe supprimé',
|
||||
duration: 2000,
|
||||
|
||||
@@ -5,8 +5,9 @@ import {addIcons} from "ionicons";
|
||||
import {sendOutline} from 'ionicons/icons';
|
||||
import {GetGroupDetailsDto, MessagesService} from "../../services/api";
|
||||
import {firstValueFrom} from "rxjs";
|
||||
|
||||
addIcons({
|
||||
"send-outline" : sendOutline
|
||||
"send-outline": sendOutline
|
||||
})
|
||||
|
||||
@Component({
|
||||
@@ -29,7 +30,7 @@ export class MessageFormComponent {
|
||||
libelle: new FormControl<string>(null, [Validators.required]),
|
||||
})
|
||||
|
||||
async sendMessageOnGroup(){
|
||||
async sendMessageOnGroup() {
|
||||
const loading = await this.loadCtrl.create({
|
||||
message: 'Envoi...',
|
||||
spinner: 'lines-sharp-small'
|
||||
@@ -51,8 +52,7 @@ export class MessageFormComponent {
|
||||
try {
|
||||
await firstValueFrom(this.messagesService.sendMessageEndpoint(this.groupId(), this.messageForm.getRawValue()));
|
||||
this.messageForm.reset();
|
||||
}
|
||||
catch {
|
||||
} catch {
|
||||
const toast = await this.toastCtrl.create({
|
||||
message: 'Impossible d\'envoyer le messages.',
|
||||
duration: 2000,
|
||||
|
||||
@@ -9,8 +9,8 @@ import {MessagesListComponent} from "../messages-list/messages-list.component";
|
||||
import {MessageFormComponent} from "../message-form/message-form.component";
|
||||
|
||||
addIcons({
|
||||
"chatbubble-ellipses-outline" : chatbubbleEllipsesOutline,
|
||||
"moon-outline" : moonOutline,
|
||||
"chatbubble-ellipses-outline": chatbubbleEllipsesOutline,
|
||||
"moon-outline": moonOutline,
|
||||
})
|
||||
|
||||
@Component({
|
||||
@@ -43,8 +43,7 @@ export class MessageComponent implements OnInit, OnDestroy {
|
||||
const messages = await firstValueFrom(this.messagesService.getMessagesEndpoint(this.groupId()));
|
||||
this.chatService.setMessages(messages);
|
||||
await this.chatService.connect(this.groupId());
|
||||
}
|
||||
catch {
|
||||
} catch {
|
||||
const toast = await this.toastCtrl.create({
|
||||
message: 'Impossible de charger les messages.',
|
||||
duration: 2000,
|
||||
|
||||
@@ -5,8 +5,7 @@ import {personOutline, addOutline, settingsOutline, informationCircleOutline} fr
|
||||
import {TitlePartComponent} from "../../components/title-part/title-part.component";
|
||||
import {ChallengeCardComponent} from "../../components/challenge-card/challenge-card.component";
|
||||
import {
|
||||
AchievementsService, CreateGroupDto,
|
||||
GetAchievementDto, GetGroupDetailsDto, GetGroupDto,
|
||||
AchievementsService, GetAchievementDto, GetGroupDetailsDto, GetGroupDto,
|
||||
GetRandomChallengeDto,
|
||||
GetUserChallengeDto,
|
||||
GetUserDetailsDto, GroupsService,
|
||||
@@ -29,7 +28,6 @@ import {GroupsComponent} from "../../components/groups/groups.component";
|
||||
import {GroupFormComponent} from "../../components/group-form/group-form.component";
|
||||
import {GroupInfoComponent} from "../../components/group-info/group-info.component";
|
||||
import {MessageComponent} from "../../components/message/message.component";
|
||||
import {MessageFormComponent} from "../../components/message-form/message-form.component";
|
||||
|
||||
addIcons({
|
||||
'profile': personOutline,
|
||||
@@ -62,7 +60,6 @@ type View = 'menu' | 'profile' | 'password' | 'designation' | 'gallery' | 'group
|
||||
GroupFormComponent,
|
||||
GroupInfoComponent,
|
||||
MessageComponent,
|
||||
MessageFormComponent,
|
||||
]
|
||||
})
|
||||
export class HomeComponent implements OnInit {
|
||||
|
||||
Reference in New Issue
Block a user