diff --git a/src/app/pages/chat/messages/messages.page.html b/src/app/pages/chat/messages/messages.page.html index 0572a94fb..461fea837 100644 --- a/src/app/pages/chat/messages/messages.page.html +++ b/src/app/pages/chat/messages/messages.page.html @@ -174,49 +174,45 @@ está a escrever ... - - {{lastAudioRecorded}} - - - - - + +
+ {{durationDisplay}} + {{lastAudioRecorded}} +
+
- - -
-
- - - -
- - diff --git a/src/app/pages/chat/messages/messages.page.scss b/src/app/pages/chat/messages/messages.page.scss index c05d06a67..2e8e61210 100644 --- a/src/app/pages/chat/messages/messages.page.scss +++ b/src/app/pages/chat/messages/messages.page.scss @@ -228,7 +228,7 @@ justify-content: center; justify-content: space-evenly; align-items: center; - + border: 1px solid red; } .chat-icon-options{ @@ -251,6 +251,7 @@ padding-left: 15px; align-items: center; overflow: auto; + border: 1px solid red; ion-textarea{ margin: 0 !important; @@ -319,4 +320,4 @@ display: block; .typing ngx-letters-avatar { padding-right: 5px; -} \ No newline at end of file +} diff --git a/src/app/pages/chat/messages/messages.page.ts b/src/app/pages/chat/messages/messages.page.ts index b1048a041..515a7cacb 100644 --- a/src/app/pages/chat/messages/messages.page.ts +++ b/src/app/pages/chat/messages/messages.page.ts @@ -83,6 +83,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { LoadedDocument: any = null; recording = false; + allowTyping = true; storedFileNames = []; lastAudioRecorded = ''; durationDisplay = ''; @@ -162,14 +163,14 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { onStart: ev => { Haptics.impact({ style: ImpactStyle.Light }) this.startRecording(); - this.calculateDuration(); + //this.calculateDuration(); }, onEnd: ev => { Haptics.impact({ style: ImpactStyle.Light }) this.stopRecording(); - setTimeout(() => { + /* setTimeout(() => { this.loadFiles(); - }, 500); + }, 500); */ } }, true); longpress.enable(); @@ -210,9 +211,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { } this.recording = true; VoiceRecorder.startRecording(); + this.calculateDuration(); } stopRecording() { + this.allowTyping = false; console.log('Stop'); if (!this.recording) { return; @@ -232,6 +235,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { }) } }) + setTimeout(() => { + this.loadFiles(); + }, 500); } async deleteRecording(fileName){ @@ -239,6 +245,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { directory: Directory.Data, path: fileName }); + this.allowTyping = true; this.lastAudioRecorded = ''; this.loadFiles(); } @@ -421,11 +428,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { this.wsChatMethodsService.getDmRoom(roomId).send({ file: { "type": "audio/aac", - "guid": '', + /* "guid": '', */ }, attachments: [{ "title": fileName , - "title_link": audioRef, + "title_link": base64Response.url, "title_link_download": true, "type": "file" }], diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 7ab471218..4ceb10632 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -167,6 +167,8 @@ export class AuthService { message.file.guid = guid.path await this.storage.set(guid.path, message.file.image_url).then(() => { console.log('add picture to chat IMAGE SAVED') + console.log(message.attachments); + message.getFileFromDb() }); diff --git a/src/app/services/chat/ws-chat.service.ts b/src/app/services/chat/ws-chat.service.ts index f0f1911bc..bea72e7de 100644 --- a/src/app/services/chat/ws-chat.service.ts +++ b/src/app/services/chat/ws-chat.service.ts @@ -703,7 +703,7 @@ updateRoomEventss(roomId, collection:string, funx: Function, ) { this.wsMsgQueue[requestId] = {message, requestId, loginRequired} } else { let messageStr = JSON.stringify(message) - // console.log('messageStr', messageStr) + console.log('messageStr', messageStr) this.socket.send(messageStr) } diff --git a/src/assets/icon/theme/default/icons-chat-record-audio.svg b/src/assets/icon/theme/default/icons-chat-record-audio.svg new file mode 100644 index 000000000..867be5447 --- /dev/null +++ b/src/assets/icon/theme/default/icons-chat-record-audio.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/assets/icon/theme/gov/icons-chat-record-audio.svg b/src/assets/icon/theme/gov/icons-chat-record-audio.svg new file mode 100644 index 000000000..6e90079a1 --- /dev/null +++ b/src/assets/icon/theme/gov/icons-chat-record-audio.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/assets/images/theme/gov/icons-chat-record-audio.svg b/src/assets/images/theme/gov/icons-chat-record-audio.svg new file mode 100644 index 000000000..48eb285e7 --- /dev/null +++ b/src/assets/images/theme/gov/icons-chat-record-audio.svg @@ -0,0 +1,4 @@ + + + +