mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
remove promise bug
This commit is contained in:
@@ -80,19 +80,21 @@ export class AppComponent {
|
|||||||
try {
|
try {
|
||||||
this.sqliteservice.databaseConn();
|
this.sqliteservice.databaseConn();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// console.log("Error creating local database: ", error)
|
console.error("Error creating local database: ", error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.storageservice.get('networkCheckStore').then((network) => {
|
/* this.storageservice.get('networkCheckStore').then((network) => {
|
||||||
if(network === 'online') {
|
if(network === 'online') {
|
||||||
// console.log('Network app componente check', network)
|
console.log('Network app componente check', network)
|
||||||
this.backgroundservice.online()
|
this.backgroundservice.online()
|
||||||
} else {
|
} else {
|
||||||
// console.log('Network app componente check', network)
|
console.log('Network app componente check', network)
|
||||||
this.backgroundservice.offline();
|
this.backgroundservice.offline();
|
||||||
}
|
}
|
||||||
})
|
}).catch((error) => {
|
||||||
|
console.error('storage initialize: ',error)
|
||||||
|
}) */
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,12 @@ export class ChatOptionsFeaturesPage implements OnInit {
|
|||||||
const file = this.fileLoaderService.getFirstFile(input)
|
const file = this.fileLoaderService.getFirstFile(input)
|
||||||
|
|
||||||
|
|
||||||
const imageData = await this.fileToBase64Service.convert(file)
|
let imageData;
|
||||||
|
try {
|
||||||
|
imageData = await this.fileToBase64Service.convert(file)
|
||||||
|
} catch (error) {
|
||||||
|
console.error('load picture chat',error)
|
||||||
|
}
|
||||||
this.capturedImage = imageData;
|
this.capturedImage = imageData;
|
||||||
this.capturedImageTitle = file.name;
|
this.capturedImageTitle = file.name;
|
||||||
|
|
||||||
|
|||||||
@@ -116,6 +116,8 @@ export class ProfilePage implements OnInit {
|
|||||||
this.DataArray.push(notificationObject)
|
this.DataArray.push(notificationObject)
|
||||||
});
|
});
|
||||||
this.notificationdata = this.DataArray
|
this.notificationdata = this.DataArray
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error('storage getnotification: ',error)
|
||||||
})
|
})
|
||||||
/* await new Promise(resolve => setTimeout(resolve, 1000));
|
/* await new Promise(resolve => setTimeout(resolve, 1000));
|
||||||
await this.getNotificationData(); */
|
await this.getNotificationData(); */
|
||||||
@@ -193,7 +195,9 @@ export class ProfilePage implements OnInit {
|
|||||||
|
|
||||||
this.storageservice.store("Notifications", JSON.stringify(this.notificationdata)).then(() => {
|
this.storageservice.store("Notifications", JSON.stringify(this.notificationdata)).then(() => {
|
||||||
this.storageservice.get("Notifications").then((value) => {
|
this.storageservice.get("Notifications").then((value) => {
|
||||||
});
|
}).catch((error) => {
|
||||||
|
console.error('storage delete notification: ',error)
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,12 @@ export class SetRoomOwnerPage implements OnInit {
|
|||||||
|
|
||||||
async setRoomOwner(user:any){
|
async setRoomOwner(user:any){
|
||||||
|
|
||||||
let res:any = await this.ChatSystemService.addRoomOwner(this.roomId, user._id);
|
let res:any;
|
||||||
|
try {
|
||||||
|
res = await this.ChatSystemService.addRoomOwner(this.roomId, user._id)
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(res.error){
|
if(res.error){
|
||||||
|
|||||||
@@ -531,6 +531,7 @@ export class AgendaPage implements OnInit {
|
|||||||
this.showTimeline = true;
|
this.showTimeline = true;
|
||||||
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
console.error(error)
|
||||||
this.getFromDB();
|
this.getFromDB();
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
@@ -589,6 +590,7 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
console.error(error)
|
||||||
this.getFromDB()
|
this.getFromDB()
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
@@ -622,6 +624,7 @@ export class AgendaPage implements OnInit {
|
|||||||
this.showTimeline = true;
|
this.showTimeline = true;
|
||||||
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
console.error(error)
|
||||||
this.getFromDB();
|
this.getFromDB();
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
@@ -646,6 +649,7 @@ export class AgendaPage implements OnInit {
|
|||||||
this.showTimeline = true;
|
this.showTimeline = true;
|
||||||
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
console.error(error)
|
||||||
this.getFromDB()
|
this.getFromDB()
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
@@ -686,6 +690,7 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
console.error(error)
|
||||||
this.getFromDB()
|
this.getFromDB()
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
counter++;
|
counter++;
|
||||||
@@ -757,6 +762,7 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
console.error(error)
|
||||||
this.getFromDB()
|
this.getFromDB()
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
@@ -794,6 +800,7 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
console.error(error)
|
||||||
this.getFromDB()
|
this.getFromDB()
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
counter++;
|
counter++;
|
||||||
@@ -840,6 +847,7 @@ export class AgendaPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
console.error(error)
|
||||||
this.getFromDB()
|
this.getFromDB()
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
@@ -995,7 +1003,9 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
}).catch ((error) => {
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,7 +148,9 @@ export class ViewEventPage implements OnInit {
|
|||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
}).catch ((error) => {
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -403,10 +403,14 @@ export class ChatPage implements OnInit {
|
|||||||
//
|
//
|
||||||
|
|
||||||
//
|
//
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error('storage getdirectmessagedb: ',error)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.storageservice.get('chatusers').then((users) => {
|
this.storageservice.get('chatusers').then((users) => {
|
||||||
this.dmUsers = users.filter(data => data.username != SessionStore.user.UserName);
|
this.dmUsers = users.filter(data => data.username != SessionStore.user.UserName);
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error('storage getchatusers: ',error)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.sqlservice.getAllChatRoom().then((rooms: any) => {
|
this.sqlservice.getAllChatRoom().then((rooms: any) => {
|
||||||
@@ -557,10 +561,14 @@ export class ChatPage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error('storage getGrup Romm db: ',error)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.storageservice.get('chatusers').then((users) => {
|
this.storageservice.get('chatusers').then((users) => {
|
||||||
this.dmUsers = users.filter(data => data.username != SessionStore.user.UserName);
|
this.dmUsers = users.filter(data => data.username != SessionStore.user.UserName);
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error('storage getgrupDb: ',error)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.sqlservice.getAllChatRoom().then((rooms: any) => {
|
this.sqlservice.getAllChatRoom().then((rooms: any) => {
|
||||||
@@ -662,7 +670,9 @@ export class ChatPage implements OnInit {
|
|||||||
else {
|
else {
|
||||||
//Check if modal is opened
|
//Check if modal is opened
|
||||||
if (this.segment == "Grupos" && this.showGroupMessages != true) {
|
if (this.segment == "Grupos" && this.showGroupMessages != true) {
|
||||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
await new Promise(resolve => setTimeout(resolve, 1000)).catch ((error) => {
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
//await this.getGroups();
|
//await this.getGroups();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -733,7 +733,9 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
||||||
|
|
||||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
|
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
||||||
|
console.error(error);
|
||||||
|
})));
|
||||||
const blob = this.base64toBlob(encodedData, file.type)
|
const blob = this.base64toBlob(encodedData, file.type)
|
||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
@@ -977,7 +979,9 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
} else {
|
} else {
|
||||||
//Check if modal is opened
|
//Check if modal is opened
|
||||||
if (document.querySelector('.isGroupChatOpened')) {
|
if (document.querySelector('.isGroupChatOpened')) {
|
||||||
await new Promise(resolve => setTimeout(resolve, 5000));
|
await new Promise(resolve => setTimeout(resolve, 5000)).catch ((error) => {
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
await this.serverLongPull();
|
await this.serverLongPull();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,6 +154,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
// this.chatService.refreshtoken();
|
// this.chatService.refreshtoken();
|
||||||
this.ChatSystemService.getUserOfRoom(this.roomId).then((value) => {
|
this.ChatSystemService.getUserOfRoom(this.roomId).then((value) => {
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error(error)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.getChatMembers();
|
this.getChatMembers();
|
||||||
@@ -747,7 +749,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
||||||
|
|
||||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
|
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
||||||
|
console.error(error);
|
||||||
|
})));
|
||||||
const blob = this.base64toBlob(encodedData, file.type)
|
const blob = this.base64toBlob(encodedData, file.type)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,9 @@ export class EventsPage implements OnInit {
|
|||||||
|
|
||||||
if(this.loggeduser.OwnerCalendars.length >= 1) {
|
if(this.loggeduser.OwnerCalendars.length >= 1) {
|
||||||
|
|
||||||
let onwEvent:any = await this.eventService.getAllOwnEvents(start, end)
|
let onwEvent:any = await this.eventService.getAllOwnEvents(start, end).catch((error) => {
|
||||||
|
console.error(error)
|
||||||
|
})
|
||||||
this.listToPresent = onwEvent;
|
this.listToPresent = onwEvent;
|
||||||
this.totalEvent = onwEvent.length;
|
this.totalEvent = onwEvent.length;
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ convertBlobToBase64 = (blob) => new Promise((resolve, reject) => {
|
|||||||
resolve(reader.result);
|
resolve(reader.result);
|
||||||
};
|
};
|
||||||
reader.readAsDataURL(blob);
|
reader.readAsDataURL(blob);
|
||||||
});
|
}).catch ((error) => {
|
||||||
|
console.error(error);
|
||||||
|
});;
|
||||||
|
|
||||||
onmessage = async function(oEvent) {
|
onmessage = async function(oEvent) {
|
||||||
const result = await convertBlobToBase64(oEvent.data);
|
const result = await convertBlobToBase64(oEvent.data);
|
||||||
|
|||||||
@@ -142,6 +142,8 @@ export class NewPublicationPage implements OnInit {
|
|||||||
resolve(reader.result);
|
resolve(reader.result);
|
||||||
};
|
};
|
||||||
reader.readAsDataURL(blob);
|
reader.readAsDataURL(blob);
|
||||||
|
}).catch ((error) => {
|
||||||
|
console.error(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ export class AlertService {
|
|||||||
|
|
||||||
this.ChatSystemService.deleteMessage(msgId).then(() => {
|
this.ChatSystemService.deleteMessage(msgId).then(() => {
|
||||||
room.deleteMessage(msgId)
|
room.deleteMessage(msgId)
|
||||||
})
|
}).catch((error) => console.error(error))
|
||||||
//this.ChatSystemService.subscribeToRoomUpdate(room._id, room);
|
//this.ChatSystemService.subscribeToRoomUpdate(room._id, room);
|
||||||
//loader.remove();
|
//loader.remove();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,8 +129,8 @@ export class AuthService {
|
|||||||
|
|
||||||
// alert('wsLogin')
|
// alert('wsLogin')
|
||||||
|
|
||||||
}).catch((message) => {
|
}).catch((error) => {
|
||||||
// alert('ws login failed')
|
console.error(error)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ export class AuthService {
|
|||||||
|
|
||||||
return true
|
return true
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
|
console.error('BeforesendAtachment', e)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ export class AuthService {
|
|||||||
return true
|
return true
|
||||||
|
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
|
console.error('BeforesendAtachment', e)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -231,6 +231,8 @@ export class AuthService {
|
|||||||
getUserData() {
|
getUserData() {
|
||||||
this.storageService.get(AuthConnstants.AUTH).then(res=>{
|
this.storageService.get(AuthConnstants.AUTH).then(res=>{
|
||||||
this.userData$.next(res);
|
this.userData$.next(res);
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error('storage getuserdata',error)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -326,7 +326,9 @@ export class ChatService {
|
|||||||
//showMessage(response.statusText);
|
//showMessage(response.statusText);
|
||||||
this.getRoomMessages(roomId)
|
this.getRoomMessages(roomId)
|
||||||
// Reconnect in one second
|
// Reconnect in one second
|
||||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
await new Promise(resolve => setTimeout(resolve, 1000)).catch ((error) => {
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
await this.subscribe(roomId);
|
await this.subscribe(roomId);
|
||||||
} else {
|
} else {
|
||||||
// Got message
|
// Got message
|
||||||
|
|||||||
@@ -183,7 +183,12 @@ export class ChatSystemService {
|
|||||||
|
|
||||||
async getAllRooms () {
|
async getAllRooms () {
|
||||||
this.loadingWholeList = true
|
this.loadingWholeList = true
|
||||||
const rooms = await this.RochetChatConnectorService.getRooms();
|
var rooms;
|
||||||
|
try {
|
||||||
|
rooms = await this.RochetChatConnectorService.getRooms();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('chatgetrooms',error)
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
await this.storage.remove('Rooms');
|
await this.storage.remove('Rooms');
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
|
|||||||
@@ -166,7 +166,11 @@ export class MessageService {
|
|||||||
|
|
||||||
let uploadSuccessfully = false
|
let uploadSuccessfully = false
|
||||||
if(this.hasSendAttachment == false) {
|
if(this.hasSendAttachment == false) {
|
||||||
uploadSuccessfully = await this.NfService.beforeSendAttachment(this)
|
try {
|
||||||
|
uploadSuccessfully = await this.NfService.beforeSendAttachment(this)
|
||||||
|
} catch (error) {
|
||||||
|
console.error('beforeSendAttachment uploadSuccessfully',error)
|
||||||
|
}
|
||||||
this.UploadAttachmentsTemp++
|
this.UploadAttachmentsTemp++
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,13 +190,17 @@ export class MessageService {
|
|||||||
this.RochetChatConnectorService.registerCallback({
|
this.RochetChatConnectorService.registerCallback({
|
||||||
type: 'reConnect',
|
type: 'reConnect',
|
||||||
funx: async ()=> {
|
funx: async ()=> {
|
||||||
this.send()
|
this.send().catch((error) =>{
|
||||||
|
console.error(error)
|
||||||
|
})
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
} else if(uploadSuccessfully == false && this.UploadAttachmentsTemp == 1) {
|
} else if(uploadSuccessfully == false && this.UploadAttachmentsTemp == 1) {
|
||||||
this.send()
|
this.send().catch((error) =>{
|
||||||
|
console.error(error)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
else if(uploadSuccessfully == false) {
|
else if(uploadSuccessfully == false) {
|
||||||
|
|
||||||
@@ -225,7 +233,9 @@ export class MessageService {
|
|||||||
this.messageSend = true
|
this.messageSend = true
|
||||||
this.redefinedMessage(ChatMessage)
|
this.redefinedMessage(ChatMessage)
|
||||||
}
|
}
|
||||||
)
|
).catch((error) => {
|
||||||
|
console.error(error)
|
||||||
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// console.log("reconnect")
|
// console.log("reconnect")
|
||||||
@@ -233,7 +243,9 @@ export class MessageService {
|
|||||||
type: 'reConnect',
|
type: 'reConnect',
|
||||||
funx: async ()=> {
|
funx: async ()=> {
|
||||||
|
|
||||||
this.send()
|
this.send().catch((error) =>{
|
||||||
|
console.error(error)
|
||||||
|
})
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -630,7 +630,7 @@ export class RoomService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(lastIsTyping != this.isTyping) {
|
if(lastIsTyping != this.isTyping) {
|
||||||
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping)
|
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping).catch((error) => console.error(error));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -639,7 +639,7 @@ export class RoomService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sendFalseTypingReadMessage(method,param: object) {
|
sendFalseTypingReadMessage(method,param: object) {
|
||||||
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', {method:method, params: param} as falseTypingMethod)
|
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', {method:method, params: param} as falseTypingMethod).catch((error) => console.error(error))
|
||||||
this.setTypingOff()
|
this.setTypingOff()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -651,7 +651,7 @@ export class RoomService {
|
|||||||
|
|
||||||
if(this.isTyping == true) {
|
if(this.isTyping == true) {
|
||||||
this.isTyping = false
|
this.isTyping = false
|
||||||
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping)
|
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping).catch((error) => console.error(error))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -675,7 +675,7 @@ export class RoomService {
|
|||||||
|
|
||||||
|
|
||||||
leave(rid?) {
|
leave(rid?) {
|
||||||
this.RochetChatConnectorService.leaveRoom(this.id)
|
this.RochetChatConnectorService.leaveRoom(this.id).catch((error) => console.error(error))
|
||||||
}
|
}
|
||||||
|
|
||||||
isJson(str) {
|
isJson(str) {
|
||||||
@@ -1003,7 +1003,9 @@ export class RoomService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sendReadMessage() {
|
sendReadMessage() {
|
||||||
this.RochetChatConnectorService.readMessage(this.id)
|
this.RochetChatConnectorService.readMessage(this.id).catch((error) =>{
|
||||||
|
console.error(error)
|
||||||
|
})
|
||||||
this.sendFalseTypingReadMessage('viewMessage', {})
|
this.sendFalseTypingReadMessage('viewMessage', {})
|
||||||
this.messageUnread = false
|
this.messageUnread = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ export class NotificationsService {
|
|||||||
|
|
||||||
this.storageService.get("Notifications").then((value) => {
|
this.storageService.get("Notifications").then((value) => {
|
||||||
|
|
||||||
}).catch(()=>{
|
}).catch((error)=>{
|
||||||
|
console.error('storage getnotification',error)
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
|
|
||||||
this.storageService.store("Notifications", [])
|
this.storageService.store("Notifications", [])
|
||||||
@@ -122,8 +122,12 @@ export class NotificationsService {
|
|||||||
}, (error) => {
|
}, (error) => {
|
||||||
//console.log(error)
|
//console.log(error)
|
||||||
})
|
})
|
||||||
});
|
}).catch((error) => {
|
||||||
|
console.error('storage authorization', error)
|
||||||
|
});;
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error('storage getAndPostToken', error)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -533,7 +533,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
this.getRoomInfo();
|
this.getRoomInfo();
|
||||||
this.closeAllDesktopComponents.emit();
|
this.closeAllDesktopComponents.emit();
|
||||||
this.showEmptyContainer.emit();
|
this.showEmptyContainer.emit();
|
||||||
this.ChatSystemService.hidingRoom(this.roomId);
|
this.ChatSystemService.hidingRoom(this.roomId).catch((error) => console.error(error));
|
||||||
}
|
}
|
||||||
else if (res.data == 'delete') {
|
else if (res.data == 'delete') {
|
||||||
this.closeAllDesktopComponents.emit();
|
this.closeAllDesktopComponents.emit();
|
||||||
@@ -878,7 +878,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
|
|
||||||
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
||||||
|
|
||||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
|
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
||||||
|
console.error(error);
|
||||||
|
})));
|
||||||
const blob = this.base64toBlob(encodedData, file.type)
|
const blob = this.base64toBlob(encodedData, file.type)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -812,7 +812,9 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
||||||
|
|
||||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
|
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
||||||
|
console.error(error);
|
||||||
|
})));
|
||||||
const blob = this.base64toBlob(encodedData, file.type)
|
const blob = this.base64toBlob(encodedData, file.type)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -82,9 +82,12 @@ export class ChatPopoverPage implements OnInit {
|
|||||||
|
|
||||||
let body = { "roomId":this.roomId, }
|
let body = { "roomId":this.roomId, }
|
||||||
|
|
||||||
let res:any = await this.ChatSystemService.leaveRoom(this.roomId);
|
let res:any;
|
||||||
|
try {
|
||||||
|
res = await this.ChatSystemService.leaveRoom(this.roomId);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
if(res.error){
|
if(res.error){
|
||||||
if(res.error.error = "error-you-are-last-owner"){
|
if(res.error.error = "error-you-are-last-owner"){
|
||||||
this.toastService._badRequest("Você é o último administrador do grupo. Por favor, defina o novo administrador antes de sair da grupo.");
|
this.toastService._badRequest("Você é o último administrador do grupo. Por favor, defina o novo administrador antes de sair da grupo.");
|
||||||
|
|||||||
Reference in New Issue
Block a user