mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
save
This commit is contained in:
@@ -229,8 +229,6 @@ export class HomePage implements OnInit {
|
||||
}
|
||||
|
||||
async viewPublications(folderId) {
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewPublicationsPage,
|
||||
/* enterAnimation,
|
||||
|
||||
@@ -9,6 +9,7 @@ import { ContactsPage } from './messages/contacts/contacts.page';
|
||||
import { MessagesPage } from './messages/messages.page';
|
||||
import { NewGroupPage } from './new-group/new-group.page';
|
||||
import { NewchatPage } from './newchat/newchat.page';
|
||||
import { Storage } from '@ionic/storage';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat',
|
||||
@@ -24,7 +25,7 @@ export class ChatPage implements OnInit {
|
||||
X_User_Id:any;
|
||||
X_Auth_Token:any;
|
||||
|
||||
loggedUser: any;
|
||||
private loggedUser: any;
|
||||
/* Set segment variable */
|
||||
segment:string;
|
||||
allGroups: any[];
|
||||
@@ -42,20 +43,29 @@ export class ChatPage implements OnInit {
|
||||
private chatService: ChatService,
|
||||
private modalController: ModalController,
|
||||
private authService: AuthService,
|
||||
private storage:Storage,
|
||||
|
||||
) {
|
||||
this.headers = new HttpHeaders();
|
||||
this.headers = this.headers.set('X-User-Id', 'GqjNWiLrGEHRna7Zn');
|
||||
this.headers = this.headers.set('X-Auth-Token', 'SJwIgtlqfloPK696fpc2VBvyDluipuIHKB_0Q6-9ycJ');
|
||||
/* this.headers = this.headers.set('X-User-Id', 'GqjNWiLrGEHRna7Zn');
|
||||
this.headers = this.headers.set('X-Auth-Token', 'SJwIgtlqfloPK696fpc2VBvyDluipuIHKB_0Q6-9ycJ'); */
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.segment = "Contactos";
|
||||
|
||||
this.authService.userData$.subscribe((res:any)=>{
|
||||
this.loggedUser=res;
|
||||
console.log(this.loggedUser);
|
||||
});
|
||||
this.load();
|
||||
this.storage.get('userDataKey').then(val=> {
|
||||
let t = JSON.parse(unescape(atob(val)));
|
||||
this.loggedUser=t;
|
||||
this.load();
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
onSegmentChange(){
|
||||
|
||||
@@ -52,12 +52,9 @@ export class AuthService {
|
||||
|
||||
result = await this.http.get<boolean>(service, options).toPromise();
|
||||
response = await this.http.post<any>(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise();
|
||||
/* this.http.post(environment.apiURL + "UserAuthentication/Login", '', this.opts).subscribe(res=>{
|
||||
this.storageService.store(AuthConnstants.USER, res);
|
||||
this.ValidatedUser = user;
|
||||
response = user;
|
||||
console.log(user);
|
||||
}); */
|
||||
|
||||
console.log(response);
|
||||
|
||||
|
||||
if (result)
|
||||
{
|
||||
|
||||
@@ -87,6 +87,7 @@ export class ChatService {
|
||||
|
||||
//Load messages from roomId
|
||||
getAllDirectMessages(){
|
||||
console.log(this.options);
|
||||
return this.http.get(environment.apiChatUrl+'im.list', this.options);
|
||||
}
|
||||
//Load messages from roomId
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DatabaseService } from './database.service';
|
||||
|
||||
describe('DatabaseService', () => {
|
||||
let service: DatabaseService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(DatabaseService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DatabaseService {
|
||||
|
||||
constructor() { }
|
||||
}
|
||||
@@ -15,11 +15,9 @@ const { Storage } = Plugins; */
|
||||
}
|
||||
// Get the value
|
||||
async get(key: string) {
|
||||
const ret = await this.storage.get(key).then((val) => {
|
||||
return val;
|
||||
});
|
||||
const ret = await this.storage.get(key).then((val) => { return val; });
|
||||
return JSON.parse(unescape(atob(ret)));
|
||||
}
|
||||
}
|
||||
/*
|
||||
// Get the value
|
||||
async get(storageKey: string) {
|
||||
|
||||
Reference in New Issue
Block a user