diff --git a/angular.json b/angular.json index 50ef54e6d..ecd38fe24 100644 --- a/angular.json +++ b/angular.json @@ -84,8 +84,7 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "app:build", - "proxyConfig": "proxy.config.json" + "browserTarget": "app:build" }, "configurations": { "production": { diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index b28faf780..41d4fa1de 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -95,7 +95,7 @@ export class HomePage implements OnInit { } - + goto(url) { this.router.navigate([url]) } @@ -106,10 +106,10 @@ export class HomePage implements OnInit { /* this.network.checkNetworkConnection; this.network.checkNetworkDisconnection; */ // console.log('Active route ', this.router.url) - + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { - this.webnotification.webconnection(); - this.webnotification.onReceviNotificationWeb(); + /* this.webnotification.webconnection(); + this.webnotification.onReceviNotificationWeb(); */ } else { this.mobilefirstConnect(); this.notificationsService.getAndpostToken2(); @@ -132,13 +132,13 @@ export class HomePage implements OnInit { if(window['WLAuthorizationManager']) { if(window['WLAuthorizationManager'].obtainAccessToken) { window['WLAuthorizationManager'].obtainAccessToken("").then((token) => { - + console.log('MobileFirst Server connect: Success ' + token); - + var resourceRequest = new WLResourceRequest("/adapters/javaAdapter/resource/greet/", WLResourceRequest.GET ); - + resourceRequest.setQueryParameter("name", "world"); resourceRequest.send().then( (response) => { @@ -178,7 +178,7 @@ export class HomePage implements OnInit { synchro.registerCallback('Offline',()=>{ - + }) synchro.conected @@ -186,7 +186,7 @@ export class HomePage implements OnInit { synchro.registerCallback('Notification', (DataArray)=> { this.webNotificationPopupService.sendNotification(DataArray) - + this.storageService.get('Notifications').then((data:any)=>{ data.push(DataArray) this.storageService.store("Notifications", data) @@ -196,7 +196,7 @@ export class HomePage implements OnInit { a.push(DataArray) this.storageService.store("Notifications",a) }) - + }, 'any') @@ -204,7 +204,7 @@ export class HomePage implements OnInit { document.addEventListener('pause', function () { // console.log('App going to background'); }); - + document.addEventListener('resume', function () { // console.log('App coming to foreground'); }); diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index d8094ed39..ca61b3319 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -65,7 +65,7 @@ export class AuthService { } SetSession(response: LoginUserRespose, user:UserForm) { - const session: UserSession = Object.assign(SessionStore.user, response) + const session: UserSession = Object.assign(SessionStore.user, response) if (response) { if( session.RoleID == 100000014) { @@ -102,6 +102,8 @@ export class AuthService { console.log('Login to Rocket chat OK'); this.ValidatedUserChat = responseChat; localStorage.setItem('userChat', JSON.stringify(responseChat)); + localStorage.setItem('Meteor.loginToken', JSON.stringify(responseChat['data'].userId)); + localStorage.setItem('Meteor.userId', JSON.stringify(responseChat['data'].authToken)); this.storageService.store(AuthConnstants.AUTH, responseChat); return true; } diff --git a/src/app/services/chat.service.ts b/src/app/services/chat.service.ts index 6dcdf578d..3a26458bf 100644 --- a/src/app/services/chat.service.ts +++ b/src/app/services/chat.service.ts @@ -9,7 +9,6 @@ import { Storage } from '@ionic/storage'; import { Message } from 'src/app/models/message.model'; import { Observable, Subject } from "rxjs/Rx"; import { WebsocketService } from './websocket.service'; -import { FileService } from './functions/file.service'; @Injectable({ providedIn: 'root' @@ -32,7 +31,6 @@ export class ChatService { private authService: AuthService, private storage: Storage, private storageService:StorageService, - private fileService: FileService, //private wsService: WebsocketService, ) { @@ -63,7 +61,7 @@ export class ChatService { }; let fullUrl = "https://www.tabularium.pt/" + url; return this.http.get(fullUrl, optionsc).subscribe(()=>{ - this.fileService.viewDocumentByUrl(url) + //this.fileService.viewDocumentByUrl(url) }); } diff --git a/src/app/services/functions/file.service.ts b/src/app/services/functions/file.service.ts index 037f7031a..7c5ef6289 100644 --- a/src/app/services/functions/file.service.ts +++ b/src/app/services/functions/file.service.ts @@ -252,7 +252,7 @@ export class FileService { } viewDocumentByUrl(url) { - const browser = this.iab.create(url,"_blank"); + const browser = this.iab.create(url,"_parent"); browser.show(); } } diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html index 2884c0109..e49e36a1c 100644 --- a/src/app/shared/chat/messages/messages.page.html +++ b/src/app/shared/chat/messages/messages.page.html @@ -51,7 +51,7 @@