This commit is contained in:
Eudes Inácio
2022-04-18 15:27:49 +01:00
19 changed files with 183 additions and 50 deletions
+47
View File
@@ -0,0 +1,47 @@
image: docker:latest
variables:
DOCKER_DRIVER: overlay
stages:
#- Install
- Test
#- Deploy
services:
- docker:dind
before_script:
- docker info
- apk update
- apk upgrade
- apk add --update bash
- apk add curl jq python3 python3-dev build-base libffi-dev libressl-dev gettext
#- curl -O https://bootstrap.pypa.io/get-pip.py
#- python3 get-pip.py
#- pip install docker-compose
#- mkdir -p ~/.ssh && chmod 700 ~/.ssh && echo "$SSH_KRY" > ~/.ssh/id_rsa.pub
#- cat ~/.ssh/id_rsa.pub
#- cp ./.env.example ./.env
#- echo "$SSH_PASS"
#'Install':
# stage: Install
# script:
# - docker-compose -f docker/docker-compose-install.yml build
'Test':
stage: Test
script:
- docker build .
#'API deploy':
# stage: Deploy
# script:
# - sshpass -p'R!9rayBAHx#asWA2' ssh -o StrictHostKeyChecking=no root@160.242.22.23 'cd project; cd digipay-compose; cd service; cd digipay; ls; git pull origin master; cd ..; cd ..; docker-compose -f docker-compose-prod.yml up -d --no-deps --build backend; exit'
# - ssh -o StrictHostKeyChecking=no root@160.242.22.23 "ls"
# only:
# # Trigger deployments only from master branch
# - master
+68
View File
@@ -0,0 +1,68 @@
# # Stage 1: Compile and Build angular codebase
# # Use official node image as the base image
FROM node:14.15.0 as build
# # Set up ENV
ENV NODE_ENV=production
# Set the working directory
WORKDIR /usr/local/app
# # Install all the dependencies
RUN npm config set unsafe-perm true
RUN npm ci
RUN npm audit fix
RUN npm install -g @ionic/cli
RUN npm install -g @angular/cli
RUN npm install -g cordova
RUN npm install -g cordova-res
# # # Generate the build of the application
RUN ionic build --prod
# # Add the source code to app
COPY ./www /usr/local/app/
# # Stage 2: Serve app with nginx server
# # Use official nginx image as the base image
# FROM nginx:latest
# Copy the build output to replace the default nginx contents.
#COPY ./www/ /usr/share/nginx/html/
# Expose port 80
# EXPOSE 80
#CMD ["nginx", "-g", "daemon off;"]
@@ -7,6 +7,7 @@ import { ChatService } from 'src/app/services/chat.service';
import { NewGroupPage } from '../../new-group/new-group.page';
import { GroupMessagesPage } from '../group-messages.page';
import { ThemeService } from 'src/app/services/theme.service'
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-group-contacts',
@@ -31,7 +32,8 @@ export class GroupContactsPage implements OnInit {
isGroupCreated:boolean;
groupName:string;
selectedUserList:any;
sessionStore = SessionStore
constructor(
private modalController: ModalController,
private http: HttpClient,
@@ -68,7 +70,7 @@ export class GroupContactsPage implements OnInit {
this.contacts = res.users.filter(f => !this.members.some(item => item._id === f._id));
}
else{
this.contacts = res.users.filter(data => data.username != this.loggedUser.me.username);
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser);
}
this.users = this.contacts.sort((a,b) => {
if(a.name < b.name){
@@ -57,7 +57,7 @@
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
</div>
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of wsChatMethodsService.getGroupRoom(roomId).messages; let last = last" [class.messages-list-item-wrapper-active]="msg._id == selectedMsgId">
<div class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}' *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'au' && msg.t != 'ru' && msg.msg !=''" (press)="handlePress(msg._id)">
<div class='message-container incoming-{{msg.u.username!=sessionStore.user.RochetChatUser}}' *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'au' && msg.t != 'ru' && msg.msg !=''" (press)="handlePress(msg._id)">
<div class="title">
<ion-label>{{msg.u.name ?? ""}}</ion-label>
<span class="time">{{msg.duration}}</span>
@@ -78,7 +78,7 @@
</div>
<!-- <div class='message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45' *ngIf="msg.msg ==''">
<!-- <div class='message-item incoming-{{msg.u.username!=sessionStore.user.RochetChatUser}} max-width-45' *ngIf="msg.msg ==''">
<div *ngIf="msg.file.type == 'application/img'">
<div class="message-item-options d-flex justify-content-end">
</div>
@@ -102,7 +102,7 @@
</div> -->
<div *ngIf="msg.file && msg.delate == false">
<div class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}' class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}' *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru' && msg.file.type != 'application/meeting'" (press)="handlePress(msg._id)">
<div class='message-container incoming-{{msg.u.username!=sessionStore.user.RochetChatUser}}' class='message-container incoming-{{msg.u.username!=sessionStore.user.RochetChatUser}}' *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru' && msg.file.type != 'application/meeting'" (press)="handlePress(msg._id)">
<div class="title">
<ion-label>{{msg.u.name ?? ""}}</ion-label>
<span class="time">{{msg.duration}}</span>
@@ -260,11 +260,11 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
try {
this.storage.get('recordData').then((recordData) => {
console.log(recordData);
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData?.value?.recordDataBase64);
}
else {
else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`);
}
});
@@ -287,7 +287,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.recording = false;
if (result.value && result.value.recordDataBase64) {
const recordData = result.value.recordDataBase64;
//console.log(recordData);
//
const fileName = new Date().getTime() + ".mp3";
//Save file
await this.storage.set('fileName', fileName)
@@ -478,12 +478,12 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
const roomId = this.roomId
let audioFile;
this.storage.get('recordData').then((recordData) => {
console.log(recordData);
audioFile = recordData;
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
this.audioRecorded = recordData?.value?.recordDataBase64;
}
else {
else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64){
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
}
@@ -7,6 +7,7 @@ import { GroupMessagesPage } from '../../group-messages/group-messages.page';
import { MessagesPage } from '../messages.page';
import { ThemeService } from 'src/app/services/theme.service'
import { WsChatMethodsService} from 'src/app/services/chat/ws-chat-methods.service'
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-contacts',
@@ -24,6 +25,7 @@ export class ContactsPage implements OnInit {
textSearch:string;
room:any;
dm:any;
sessionStore = SessionStore
constructor(
private modalController: ModalController,
@@ -55,7 +57,7 @@ export class ContactsPage implements OnInit {
};
this.chatService.getAllUsers().subscribe((res:any)=>{
console.log(res.users);
this.contacts = res.users.filter(data => data.username != this.loggedUser.me.username);
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser);
this.users = this.contacts.sort((a,b) => {
if(a.name < b.name){
return -1;
@@ -50,7 +50,7 @@
<div class="messages-list-item-wrapper container-width-100"
*ngFor="let msg of wsChatMethodsService.getDmRoom(this.roomId).messages; let last = last"
[class.messages-list-item-wrapper-active]="msg._id == selectedMsgId">
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}'
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=sessionStore.user.RochetChatUser}}'
*ngIf="msg.msg !=''">
<div class="title">
<ion-label (click)="hkellor()">{{msg.u.name}}</ion-label>
@@ -74,7 +74,7 @@
<div *ngIf="msg.file && msg.delate == false">
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}' *ngIf="msg.file.type != 'application/meeting'">
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=sessionStore.user.RochetChatUser}}' *ngIf="msg.file.type != 'application/meeting'">
<div class="title">
<ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{msg.duration}}</span>
+7 -5
View File
@@ -46,6 +46,7 @@ import { StringDecoder } from 'string_decoder';
import { File } from '@awesome-cordova-plugins/file/ngx';
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
import { DocumentViewer } from '@awesome-cordova-plugins/document-viewer/ngx';
import { SessionStore } from 'src/app/store/session.service';
const IMAGE_DIR = 'stored-images';
@@ -110,6 +111,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
downloadLoader: boolean;
audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null
sessionStore = SessionStore
constructor(
public popoverController: PopoverController,
@@ -226,11 +228,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
try {
this.storage.get('recordData').then((recordData) => {
console.log(recordData);
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData?.value?.recordDataBase64);
}
else {
else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`);
}
});
@@ -273,7 +275,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.recording = false;
if (result.value && result.value.recordDataBase64) {
const recordData = result.value.recordDataBase64;
//console.log(recordData);
//
const fileName = new Date().getTime() + ".mp3";
//Save file
this.storage.set('fileName', fileName);
@@ -427,7 +429,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
this.audioRecorded = recordData?.value?.recordDataBase64;
}
else {
else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
}
@@ -534,7 +536,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.showLoader = true;
this.chatService.getMembers(this.roomId).subscribe(res => {
this.members = res['members'];
this.dmUsers = res['members'].filter(data => data.username != this.loggedUser.me.username)
this.dmUsers = res['members'].filter(data => data.username != this.sessionStore.user.RochetChatUser)
this.showLoader = false;
});
}
+3 -1
View File
@@ -61,7 +61,9 @@ export class AuthService {
}
if (localStorage.getItem("userChat") != null) {
this.ValidatedUserChat = JSON.parse(localStorage.getItem('userChat'));
this.ValidatedUserChat = {
data: JSON.parse(localStorage.getItem('userChat'))
};
}
}
+1
View File
@@ -51,6 +51,7 @@ export class RoomService {
messagesLocalReference = []
members = []
u
sessionStore = SessionStore
scrollDown = () => { }
@@ -41,9 +41,10 @@ export class WsChatMethodsService {
currentRoom: RoomService = null
users: chatUser[] = []
sessionStore = SessionStore
loggedUser: any;
constructor(
private WsChatService: WsChatService,
private storage: Storage,
@@ -183,7 +184,7 @@ export class WsChatMethodsService {
const res = await this.chatService.getMembers(roomId).toPromise();
const members = res['members'];
const users = members.filter(data => data.username != this.loggedUser.me.username);
const users = members.filter(data => data.username != this.sessionStore.user.RochetChatUser);
rooms.result.update[index]['members'] = users
await this.prepareRoom(roomData);
@@ -191,7 +192,7 @@ export class WsChatMethodsService {
if (roomData.t === 'p') {
const res = await this.chatService.getGroupMembers(roomId).toPromise()
const members = res['members'];
const users = members.filter(data => data.username != this.loggedUser.me.username);
const users = members.filter(data => data.username != this.sessionStore.user.RochetChatUser);
rooms.result.update[index]['members'] = users
@@ -199,7 +200,7 @@ export class WsChatMethodsService {
else {
const res = await this.chatService.getChannelMembers(roomId).toPromise()
const members = res['members'];
const users = members.filter(data => data.username != this.loggedUser.me.username);
const users = members.filter(data => data.username != this.sessionStore.user.RochetChatUser);
rooms.result.update[index]['members'] = users
+1 -1
View File
@@ -674,7 +674,7 @@ export class WsChatService {
registerCallback:(params: wsCallbacksParams) => {
let id = params.requestId || params.key || uuidv4()
console.log('register id', params)
// console.log('register id', params)
this.wsCallbacks[id] = params
this.n++
return id
@@ -7,6 +7,7 @@ import { ChatService } from 'src/app/services/chat.service';
import { NewGroupPage } from '../../new-group/new-group.page';
import { GroupMessagesPage } from '../group-messages.page';
import { ThemeService } from 'src/app/services/theme.service'
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-group-contacts',
@@ -31,6 +32,7 @@ export class GroupContactsPage implements OnInit {
isGroupCreated:boolean;
groupName:string;
selectedUserList:any;
sessionStore = SessionStore
@Input() roomId:string;
@Output() openGroupMessage:EventEmitter<any> = new EventEmitter<any>();
@@ -156,7 +158,7 @@ export class GroupContactsPage implements OnInit {
this.contacts = res.users.filter(f => !this.members.some(item => item._id === f._id));
}
else{
this.contacts = res.users.filter(data => data.username != this.loggedUser.me.username);
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser);
}
this.users = this.contacts.sort((a,b) => {
@@ -186,7 +188,7 @@ export class GroupContactsPage implements OnInit {
this.contacts = res.users.filter(f => !this.members.some(item => item._id === f._id));
}
else{
this.contacts = res.users.filter(data => data.username != this.loggedUser.me.username);
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser);
}
this.users = this.contacts.sort((a,b) => {
@@ -42,7 +42,7 @@
</div>
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of wsChatMethodsService.getGroupRoom(roomId).messages; let last = last">
<div class="message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45" *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'au' && msg.t != 'ru' && msg.msg !=''" >
<div class="message-item incoming-{{msg.u.username!=sessionStore.user.RochetChatUser}} max-width-45" *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'au' && msg.t != 'ru' && msg.msg !=''" >
<div class="message-item-options d-flex justify-content-end">
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
<mat-menu #beforeMenu="matMenu" xPosition="before">
@@ -69,7 +69,7 @@
</div>
<div *ngIf="msg.file">
<div class="message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45" *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'au' && msg.t != 'ru' && msg.file.type != 'application/meeting'" >
<div class="message-item incoming-{{msg.u.username!=sessionStore.user.RochetChatUser}} max-width-45" *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'au' && msg.t != 'ru' && msg.file.type != 'application/meeting'" >
<div *ngIf="msg.file.type != 'application/meeting'">
<div class="message-item-options d-flex justify-content-end">
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
@@ -39,6 +39,7 @@ import { DomSanitizer } from '@angular/platform-browser';
import { AlertController, NavParams } from '@ionic/angular';
import { File } from '@awesome-cordova-plugins/file/ngx';
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
import { SessionStore } from 'src/app/store/session.service';
/*
@@ -104,6 +105,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
duration = 0;
audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null
sessionStore = SessionStore
constructor(
public wsChatMethodsService: WsChatMethodsService,
@@ -287,11 +289,11 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
})
this.storage.get('recordData').then((recordData) => {
console.log(recordData);
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData?.value?.recordDataBase64);
}
else {
else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`);
}
});
@@ -334,7 +336,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
this.recording = false;
if (result.value && result.value.recordDataBase64) {
const recordData = result.value.recordDataBase64;
//console.log(recordData);
//
const fileName = new Date().getTime() + ".mp3";
//Save file
this.storage.set('fileName', fileName);
@@ -462,12 +464,12 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
const roomId = this.roomId
let audioFile;
this.storage.get('recordData').then((recordData) => {
console.log(recordData);
audioFile = recordData;
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
this.audioRecorded = recordData?.value?.recordDataBase64;
}
else {
else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
}
@@ -7,6 +7,7 @@ import { GroupMessagesPage } from '../../group-messages/group-messages.page';
import { MessagesPage } from '../messages.page';
import { ThemeService } from 'src/app/services/theme.service'
import { WsChatMethodsService} from 'src/app/services/chat/ws-chat-methods.service'
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-contacts',
@@ -24,6 +25,7 @@ export class ContactsPage implements OnInit {
textSearch:string;
room:any;
dm:any;
sessionStore = SessionStore
@Output() openMessage:EventEmitter<any> = new EventEmitter<any>();
@@ -71,8 +73,8 @@ export class ContactsPage implements OnInit {
};
this.chatService.getAllUsers().subscribe((res:any)=>{
console.log(res.users);
//this.contacts = res.users.filter(data => data.username != this.loggedUser.me.username);
this.contacts = res.users.filter(data => data.username != this.loggedUser.me.username);
//this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser);
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser);
this.users = this.contacts.sort((a,b) => {
if(a.name < b.name){
return -1;
@@ -36,7 +36,7 @@
<div class="messages" #scrollMe>
<div class="messages-list-item-wrapper container-width-100"
*ngFor="let msg of wsChatMethodsService.getDmRoom(roomId).messages; index as i; let last = last">
<div class='message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45' *ngIf="msg.msg !=''">
<div class='message-item incoming-{{msg.u.username!=sessionStore.user.RochetChatUser}} max-width-45' *ngIf="msg.msg !=''">
<div class="message-item-options d-flex justify-content-end">
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer">
</fa-icon>
@@ -65,7 +65,7 @@
</div>
<div *ngIf="msg.file && msg.delate == false">
<div class='message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'
<div class='message-item incoming-{{msg.u.username!=sessionStore.user.RochetChatUser}} max-width-45'
*ngIf="msg.file.type != 'application/meeting'">
<div class="message-item-options d-flex justify-content-end">
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer">
+11 -9
View File
@@ -38,6 +38,7 @@ import { DomSanitizer } from '@angular/platform-browser';
import { AlertController, Platform, NavParams } from '@ionic/angular';
import { File } from '@awesome-cordova-plugins/file/ngx';
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
import { SessionStore } from 'src/app/store/session.service';
const IMAGE_DIR = 'stored-images';
@@ -95,6 +96,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
duration = 0;
audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null
sessionStore = SessionStore
constructor(
public popoverController: PopoverController,
@@ -281,11 +283,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
})
this.storage.get('recordData').then((recordData) => {
console.log(recordData);
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData?.value?.recordDataBase64);
}
else {
else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`);
}
});
@@ -293,11 +295,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.storage.get('recordData').then((recordData) => {
console.log(recordData);
if (recordData.value.recordDataBase64.includes('data:audio')) {
if (recordData?.value?.recordDataBase64?.includes('data:audio')) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData.value.recordDataBase64);
}
else {
else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`);
}
});
@@ -337,7 +339,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.recording = false;
if (result.value && result.value.recordDataBase64) {
const recordData = result.value.recordDataBase64;
//console.log(recordData);
//
const fileName = new Date().getTime() + ".mp3";
//Save file
this.storage.set('fileName', fileName);
@@ -406,10 +408,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
const roomId = this.roomId
let audioFile;
this.storage.get('recordData').then((recordData) => {
console.log(recordData);
audioFile = recordData;
if (recordData.value.recordDataBase64.includes('data:audio')) {
if (recordData?.value?.recordDataBase64?.includes('data:audio')) {
this.audioRecorded = recordData.value.recordDataBase64;
}
else {
@@ -543,7 +545,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
//this.showLoader = true;
this.chatService.getMembers(this.roomId).subscribe(res => {
this.members = res['members'];
this.dmUsers = res['members'].filter(data => data.username != this.loggedUser.me.username)
this.dmUsers = res['members'].filter(data => data.username != this.sessionStore.user.RochetChatUser)
this.showLoader = false;
});
}
+4 -4
View File
@@ -23,10 +23,10 @@ export const environment = {
production: false,
//apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/',
apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/',
//apiChatUrl: 'https://gabinetedigitalchat.dyndns.info/api/v1/',
//apiWsChatUrl: 'wss://gabinetedigitalchat.dyndns.info/websocket',
apiChatUrl: 'https://www.tabularium.pt/api/v1/',
apiWsChatUrl: 'wss://www.tabularium.pt/websocket',
apiChatUrl: 'https://gabinetedigitalchat.dyndns.info/api/v1/',
apiWsChatUrl: 'wss://gabinetedigitalchat.dyndns.info/websocket',
//apiChatUrl: 'https://www.tabularium.pt/api/v1/',
//apiWsChatUrl: 'wss://www.tabularium.pt/websocket',
/* apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/', */
domain: 'gabinetedigital.local', //gabinetedigital.local
defaultuser: 'paulo.pinto@gabinetedigital.local',//paulo.pinto paulo.pinto@gabinetedigital.local