fix ios notifications

This commit is contained in:
Lorito Tiago
2023-10-09 14:15:21 +01:00
parent 76f8ac976a
commit cca49822b3
70 changed files with 7451 additions and 44713 deletions
+18 -18
View File
@@ -33,11 +33,11 @@ export class InactivityPage implements OnInit {
public alertController: AlertController,
public ThemeService: ThemeService,
public p: PermissionService,
) {}
) { }
loop = false
ngOnInit() {}
ngOnInit() { }
runloop() {
@@ -71,7 +71,7 @@ export class InactivityPage implements OnInit {
async Login() {
if (this.validateUsername()) {
if(this.validatePassword()) {
if (this.validatePassword()) {
this.userattempt = {
username: this.username,
@@ -79,7 +79,7 @@ export class InactivityPage implements OnInit {
domainName: environment.domain,
BasicAuthKey: ""
}
let attempt = await this.authService.login(this.userattempt, {saveSession: false})
let attempt = await this.authService.login(this.userattempt, { saveSession: false })
if (attempt) {
@@ -88,7 +88,7 @@ export class InactivityPage implements OnInit {
if (attempt.UserId == SessionStore.user.UserId) {
await this.authService.SetSession(attempt, this.userattempt);
if(this.p.userPermission(this.p.permissionList.Chat.access)){
if (this.p.userPermission(this.p.permissionList.Chat.access)) {
// this.authService.loginChat();
}
@@ -119,18 +119,18 @@ export class InactivityPage implements OnInit {
getToken() {
this.notificatinsservice.requestPermissions();
this.notificatinsservice.registrationError();
this.notificatinsservice.getAndpostToken(this.username);
// this.notificatinsservice.getAndpostToken(this.username);
}
setCode(code: string) {
if(this.code.length < 4) {
if (this.code.length < 4) {
this.code.push(code)
}
if(this.code.length == 4) {
if (this.code.length == 4) {
if(!SessionStore.hasPin) {
if (!SessionStore.hasPin) {
//
this.storePin()
this.pinLogin()
@@ -141,14 +141,14 @@ export class InactivityPage implements OnInit {
}
clearCode() {
this.code =[]
this.code = []
}
pinLogin() {
const code = this.code.join('')
if( SessionStore.validatePin(code)) {
if (SessionStore.validatePin(code)) {
SessionStore.setInativity(true)
this.goback()
@@ -166,26 +166,26 @@ export class InactivityPage implements OnInit {
goback() {
const pathName = this.SessionStore.user.UrlBeforeInactivity
if(pathName) {
this.router.navigate([pathName],{replaceUrl: true});
if (pathName) {
this.router.navigate([pathName], { replaceUrl: true });
} else {
setTimeout(() => {
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
if (this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)) {
//When user has got access to Agenda but does not have their own calendar, goes to Agenda
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){
if (this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0) {
this.router.navigate(['/home/agenda']);
}
else{
else {
this.router.navigate(['/home/events']);
}
}
//If user has access permission to both Chat and Action, goes to Chat by default.
else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){
else if ((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)) {
this.router.navigate(['/home/chat']);
}
else if(this.p.userPermission(this.p.permissionList.Actions.access)){
else if (this.p.userPermission(this.p.permissionList.Actions.access)) {
this.router.navigate(['/home/publications']);
}
+20 -20
View File
@@ -34,7 +34,7 @@ export class LoginPage implements OnInit {
userattempt: UserForm;
code = []
hasPin: boolean
hasPin: boolean
loginPreference: string
sessionStore = SessionStore;
@@ -56,16 +56,16 @@ export class LoginPage implements OnInit {
private ChatService: ChatService,
private platform: Platform,
private FirstEnterService: FirstEnterService,
private storage:Storage,
private storage: Storage,
private storageService: StorageService,
) {}
) { }
ngOnInit() {}
ngOnInit() { }
togglePassword() {
this.showPassword = !this.showPassword;
if(this.passwordIcon == "eye") {
if (this.passwordIcon == "eye") {
this.passwordIcon = "eye-off";
} else {
this.passwordIcon = "eye";
@@ -101,14 +101,14 @@ export class LoginPage implements OnInit {
getToken() {
this.notificatinsservice.requestPermissions();
this.notificatinsservice.registrationError();
this.notificatinsservice.getAndpostToken(this.username);
// this.notificatinsservice.getAndpostToken(this.username);
}
async Login() {
if (this.validateUsername()) {
if(this.validatePassword()) {
if (this.validatePassword()) {
this.userattempt = {
username: this.username.trim(),
@@ -119,8 +119,8 @@ export class LoginPage implements OnInit {
const loader = this.toastService.loading()
let attempt = await this.authService.login(this.userattempt, {saveSession: false})
const data = await this.authService.loginContenteProduction(this.userattempt, {saveSession: true})
let attempt = await this.authService.login(this.userattempt, { saveSession: false })
const data = await this.authService.loginContenteProduction(this.userattempt, { saveSession: true })
loader.remove()
@@ -132,7 +132,7 @@ export class LoginPage implements OnInit {
CPSession.save(data)
this.changeProfileService.run();
if(attempt.ChatData) {
if (attempt.ChatData) {
await this.authService.loginToChatWs();
this.ChatService.setheader()
@@ -167,16 +167,16 @@ export class LoginPage implements OnInit {
if(attempt.ChatData) {
if (attempt.ChatData) {
await this.authService.loginToChatWs();
this.ChatService.setheader();
this.ChatSystemService.loadChat();
}
this.storageService.remove("Notifications")
this.getToken();
this.getToken();
if(!this.platform.is('desktop') && !this.platform.is('mobileweb')) {
if(this.sessionStore.hasPin) {
if (!this.platform.is('desktop') && !this.platform.is('mobileweb')) {
if (this.sessionStore.hasPin) {
this.router.navigateByUrl('/home/events');
} else {
this.router.navigateByUrl('/pin', { replaceUrl: true });
@@ -207,23 +207,23 @@ export class LoginPage implements OnInit {
goback() {
const pathName = SessionStore.user.UrlBeforeInactivity
if(pathName) {
if (pathName) {
this.router.navigate([pathName]);
} else {
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
if (this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)) {
//When user has got access to Agenda but does not have their own calendar, goes to Agenda
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){
if (this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0) {
this.router.navigate(['/home/agenda']);
}
else{
else {
this.router.navigate(['/home/events']);
}
}
//If user has access permission to both Chat and Action, goes to Chat by default.
else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){
else if ((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)) {
this.router.navigate(['/home/chat']);
}
else if(this.p.userPermission(this.p.permissionList.Actions.access)){
else if (this.p.userPermission(this.p.permissionList.Actions.access)) {
this.router.navigate(['/home/publications']);
}
}