@@ -253,9 +253,9 @@
-
+
diff --git a/src/app/shared/chat/messages/messages.page.scss b/src/app/shared/chat/messages/messages.page.scss
index 2cce79799..b295b64fb 100644
--- a/src/app/shared/chat/messages/messages.page.scss
+++ b/src/app/shared/chat/messages/messages.page.scss
@@ -1,4 +1,4 @@
-@import '~src/function.scss';
+@import "~src/function.scss";
.header-toolbar {
--background: transparent;
@@ -29,7 +29,6 @@
margin: 2px 0 0 5px;
display: flex;
align-items: center;
-
}
.right {
@@ -45,13 +44,11 @@
width: 95%;
overflow: auto;
-
.header-bottom-icon {
width: rem(30);
font-size: rem(25);
float: left;
padding: 2px;
-
}
.header-bottom-contacts {
@@ -164,7 +161,6 @@ ion-content {
overflow: auto;
}
-
.incoming-true,
.incoming-false {
padding: 15px 20px;
@@ -267,7 +263,6 @@ ion-footer {
align-self: center;
}
}
-
}
.text-color-blue {
@@ -357,7 +352,6 @@ ion-footer {
align-items: center;
}
-
.typing ngx-letters-avatar {
padding-right: 5px;
}
@@ -390,24 +384,23 @@ ion-footer {
right: 50%;
}
-
.try {
color: red;
- background: #f3414159;
- padding: 6px;
- border-radius: 10px;
- cursor: pointer;
+ background: #f3414159;
+ padding: 6px;
+ border-radius: 10px;
+ cursor: pointer;
}
.red-top {
border-top: 1px solid red !important;
}
.red {
- color: red !important;
+ color: red !important;
}
-
-.lido, .enviado {
+.lido,
+.enviado {
font-size: rem(11);
}
diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts
index ee1447331..7af54ef91 100644
--- a/src/app/shared/chat/messages/messages.page.ts
+++ b/src/app/shared/chat/messages/messages.page.ts
@@ -100,6 +100,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
roomName: any;
isAdmin = false;
roomCountDownDate: string;
+
constructor(
public popoverController: PopoverController,
@@ -137,6 +138,9 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.showAvatar = false
+
+
+
setTimeout(() => {
this.scrollToBottomClicked()
this.showAvatar = true
@@ -144,13 +148,12 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.deleteRecording()
-
// this.ChatSystemService.getDmRoom(this.roomId).deleteAll()
}
async ChatMessageDebuggingPage() {
-
+
const modal = await this.modalController.create({
component: ChatMessageDebuggingPage,
cssClass: 'model profile-modal search-submodal',
@@ -183,6 +186,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.deleteRecording();
this.loadFiles();
+
}
@@ -612,25 +616,25 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
// convert base64 to raw binary data held in a string
// doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
var byteString = atob(dataURI.split(',')[1]);
-
+
// separate out the mime component
var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]
-
+
// write the bytes of the string to an ArrayBuffer
var ab = new ArrayBuffer(byteString.length);
-
+
// create a view into the buffer
var ia = new Uint8Array(ab);
-
+
// set the bytes of the buffer to the correct values
for (var i = 0; i < byteString.length; i++) {
- ia[i] = byteString.charCodeAt(i);
+ ia[i] = byteString.charCodeAt(i);
}
-
+
// write the ArrayBuffer to a blob, and you're done
- var blob = new Blob([ab], {type: mimeString});
+ var blob = new Blob([ab], { type: mimeString });
return blob;
-
+
}
async takePictureMobile() {
@@ -645,7 +649,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
source: CameraSource.Camera
});
- var base64 = 'data:image/jpeg;base64,' + file.base64String
+ var base64 = 'data:image/jpeg;base64,' + file.base64String
const compressedImage = await this.compressImageBase64(
base64,
800, // maxWidth
@@ -785,7 +789,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
//const imageData = await this.fileToBase64Service.convert(file)
//
- var base64 = 'data:image/jpeg;base64,' + file.base64String
+ var base64 = 'data:image/jpeg;base64,' + file.base64String
const compressedImage = await this.compressImageBase64(
base64,
800, // maxWidth
@@ -795,7 +799,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
console.log('Selected: ', picture)
base64 = picture
});
-
+
const response = await fetch(base64);
const blob = await response.blob();
@@ -827,23 +831,42 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
async addFileToChat(types: typeof FileType[]) {
+
const roomId = this.roomId
const file: any = await this.fileService.getFileFromDevice(types);
+ console.log(file.type)
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).catch ((error) => {
+ const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => {
console.error(error);
})));
- const blob = this.fileService.base64toBlob(encodedData, file.type)
- const fileBase64 = await this._getBase64(file)
+ let blob;
+ let formData
+ let fileBase64
+ if (this.platform.is("tablet")) {
+
+ blob = this.fileService.base64toBlob(encodedData, file.type)
+ console.log('BLOB BLOB', blob)
+
+ formData = new FormData();
+ formData.append('blobFile', blob);
+ /* console.log('add file', fileBase64) */
+
+ } else {
+ blob = this.fileService.base64toBlob(encodedData, file.type)
+
+ fileBase64 = await this._getBase64(file)
+
+ formData = new FormData();
+ formData.append('blobFile', blob);
+ }
+
- const formData = new FormData();
- formData.append('blobFile', blob);
this.ChatSystemService.getDmRoom(roomId).send({
@@ -872,7 +895,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
_getBase64(file) {
- return new Promise((resolve, reject)=>{
+ return new Promise((resolve, reject) => {
var reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function () {
@@ -882,7 +905,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
console.log('Error: ', error);
};
})
- }
+ }
getFileReader(): FileReader {
const fileReader = new FileReader();
const zoneOriginalInstance = (fileReader as any)["__zone_symbol__originalInstance"];
@@ -991,7 +1014,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
});
await modal.present();
-
+
}
@@ -1094,7 +1117,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.downloadFileMsg(msg)
} else {
-
+
var str = msg.attachments[0].image_url
str = str.substring(1, ((str.length) - 1));
@@ -1176,14 +1199,14 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
if (this.room.name) {
try {
this.roomName = this.room.name.split('-').join(' ');
- } catch(error) {
+ } catch (error) {
this.roomName = this.room.name;
- }
-
- }
-
+ }
- if(SessionStore.user.ChatData.data.userId == this.room.u._id){
+ }
+
+
+ if (SessionStore.user.ChatData.data.userId == this.room.u._id) {
this.isAdmin = true
} else {
this.isAdmin = false
@@ -1199,32 +1222,32 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
return new Promise((resolve, reject) => {
const image = new (window as any).Image();
image.src = base64String;
-
+
image.onload = async () => {
const canvas = document.createElement('canvas');
let newWidth = image.width;
let newHeight = image.height;
-
+
if (newWidth > maxWidth) {
newHeight *= maxWidth / newWidth;
newWidth = maxWidth;
}
-
+
if (newHeight > maxHeight) {
newWidth *= maxHeight / newHeight;
newHeight = maxHeight;
}
-
+
canvas.width = newWidth;
canvas.height = newHeight;
-
+
const context = canvas.getContext('2d');
context?.drawImage(image, 0, 0, newWidth, newHeight);
-
+
const compressedBase64 = canvas.toDataURL('image/jpeg', quality);
resolve(compressedBase64);
};
-
+
image.onerror = (error) => {
reject(error);
};
diff --git a/src/app/shared/chat/new-group/new-group.page.ts b/src/app/shared/chat/new-group/new-group.page.ts
index db2f7025a..f7801f28a 100644
--- a/src/app/shared/chat/new-group/new-group.page.ts
+++ b/src/app/shared/chat/new-group/new-group.page.ts
@@ -335,9 +335,8 @@ export class NewGroupPage implements OnInit{
{
name: 'minutes',
prefix: 'Minutos',
- selectedIndex: 3,
+ selectedIndex: 0,
options: [
- { text: '0', value: 0 },
{ text: '5', value: 5 },
{ text: '10', value: 10 },
{ text: '15', value: 15 },
diff --git a/src/app/shared/header/header.page.html b/src/app/shared/header/header.page.html
index 08a33ca51..1ab20e815 100644
--- a/src/app/shared/header/header.page.html
+++ b/src/app/shared/header/header.page.html
@@ -226,7 +226,7 @@
-

+
diff --git a/src/app/shared/header/header.page.scss b/src/app/shared/header/header.page.scss
index ddfd82478..67809cdea 100644
--- a/src/app/shared/header/header.page.scss
+++ b/src/app/shared/header/header.page.scss
@@ -1,22 +1,22 @@
-@import '~src/function.scss';
+@import "~src/function.scss";
-.div-top-header{
+.div-top-header {
margin: 0 em(20);
// background-color: #0782c9;
//padding-top: em(15px);
- border: 0!important;
+ border: 0 !important;
}
+.profile-image {
+ vertical-align: middle;
+ width: 40px;
+ height: 40px;
+ border-radius: 50%;
+ display: block; /* Torna a imagem um elemento de bloco */
+ margin: 0 auto;
+}
-
- .profile-image {
- border-radius: 80%; /* Tornar a imagem circular */
- width: 100%;
- height: 25.33%;
- overflow: auto;
- }
-
-.div-logo{
+.div-logo {
background: transparent;
width: em(140);
justify-content: center;
@@ -34,17 +34,17 @@
}
}
- .logo-description{
+ .logo-description {
width: 74.67%;
margin: 0 auto;
overflow: auto;
font-size: 8.5px;
font-family: Bahnschrift;
- .logo-description-content{
+ .logo-description-content {
width: 100%;
- .logo-description-text{
+ .logo-description-text {
font-weight: 700;
text-align: center;
width: 100%;
@@ -52,32 +52,31 @@
padding: 0 !important;
}
- .add-line{
+ .add-line {
width: 100%;
border-bottom: 1px solid #000;
margin-bottom: 2.5px !important;
padding: 0 !important;
}
- .add-line-white{
+ .add-line-white {
width: 100%;
border-bottom: 1px solid #fff;
margin-bottom: 2.5px !important;
padding: 0 !important;
}
}
- .color-white{
+ .color-white {
color: #fff !important;
}
- .add-botton-border{
+ .add-botton-border {
border-bottom: 1px solid #000;
}
- .add-botton-border-white{
+ .add-botton-border-white {
border-bottom: 1px solid #fff;
}
-
}
}
@@ -87,15 +86,15 @@
}
.div-profile {
- height: fit-content;
+ width: 40px;
+ height: 40px;
+ text-align: center;
background-color: transparent;
- overflow: auto;
display: flex !important;
- justify-content: end;
- max-width: 45px;
+ justify-content:space-around;
border-radius: 50px;
- .icon{
+ .icon {
position: relative;
border: none !important;
}
@@ -105,15 +104,15 @@
font-size: rem(12);
color: white;
text-align: center;
- width:20px;
- height:20px;
+ width: 20px;
+ height: 20px;
border-radius: 35%;
position: absolute; /* changed */
top: 5px; /* changed */
right: 27px; /* changed */
}
- .profile-text{
+ .profile-text {
font-size: rem(20);
font-weight: 300;
width: fit-content;
@@ -125,43 +124,40 @@
//border: 1px solid red;
}
-.desktop {
+.desktop {
display: none;
}
@media only screen and (min-width: 1366px) {
-
- .mobile{
+ .mobile {
display: none !important;
}
- .desktop{
+ .desktop {
display: block;
}
-
}
-.tab{
+.tab {
height: 65px;
cursor: pointer;
user-select: none;
}
-.tab:hover{
+.tab:hover {
border-top: 7px solid var(--header-tab-text-white);
}
-.active{
+.active {
border-top: 7px solid var(--header-tab-text-white);
- span{
+ span {
font-weight: 650;
}
}
-
-.search-input-container{
+.search-input-container {
background-color: white;
border-radius: 27.5px;
border: solid 1px #ebebeb;
- .icon{
+ .icon {
color: #797979;
width: rem(45);
height: rem(45);
@@ -170,15 +166,14 @@
font-size: rem(25);
align-items: center;
}
- .input-text{
+ .input-text {
width: 100%;
}
- .icon-z{
+ .icon-z {
width: 20px;
}
}
-
.tab {
color: var(--header-tab-text-white);
}
diff --git a/src/app/shared/header/header.page.ts b/src/app/shared/header/header.page.ts
index aa3bd7e41..232862f80 100644
--- a/src/app/shared/header/header.page.ts
+++ b/src/app/shared/header/header.page.ts
@@ -95,7 +95,7 @@ export class HeaderPage implements OnInit {
this.eventTriger.getObservable().subscribe((event) => {
if (event.notification == "recive") {
console.log('header', event.notification)
- this.notificationLength++
+ this.notificationLengthData()
}
});
@@ -105,21 +105,24 @@ export class HeaderPage implements OnInit {
this.eventTriger.getObservable().subscribe((event) => {
if (event.notification == "deleted") {
console.log('header', event.notification)
- this.notificationLength--
+ this.notificationLengthData()
}
});
}
async notificationLengthData() {
+ console.log('Call notification data')
await this.storageservice.get("Notifications").then((value) => {
-
+ console.log('Get notification data', )
this.notificationLength = value.length;
+ console.log('Call notification data',this.notificationLength)
}).catch((error) => {
if (!error) {
+ console.error('header storage get notification', error)
this.notificationLength = 0;
} else {
console.error('header storage get notification', error)
diff --git a/src/app/shared/popover/chat-options-popover/chat-options-popover.page.html b/src/app/shared/popover/chat-options-popover/chat-options-popover.page.html
index 53374f8c3..1d4959f4c 100644
--- a/src/app/shared/popover/chat-options-popover/chat-options-popover.page.html
+++ b/src/app/shared/popover/chat-options-popover/chat-options-popover.page.html
@@ -7,7 +7,7 @@