Skip to content
This repository has been archived by the owner on Mar 26, 2022. It is now read-only.

Connect The Client side messaging to the backend #46

Merged
merged 19 commits into from
Oct 25, 2016
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More Cleanup, and more observables
Simply need to handle errors on FB login, Create Pages provider, and finish up messages
torch2424 committed Oct 21, 2016

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit c52a93816491f879ae009c1525746ea697b20944
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ export class AllConversationsPage {
//Stop loading
self.appNotify.stopLoading().then(function() {
self.allConversations = success;
console.log(self.allConversations);
//console.log(self.allConversations);
});
}, function(error) {
//Error!
11 changes: 7 additions & 4 deletions client/secureChatIonic/app/pages/auth-login/auth-login.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';

//Pages
import { AllConversationsPage } from '../../pages/all-conversations/all-conversations';

//Import our providers (services)
import { AppSettings } from '../../providers/app-settings/app-settings';
import { AppNotify } from '../../providers/app-notify/app-notify';
@@ -55,13 +58,13 @@ export class AuthLoginPage {
//Toast What Happened
//In a timeout to avoid colliding with loading
setTimeout(function() {
//Show Toast
self.appNotify.showToast('Login Successful!');

//Redirect to messages page
self.navCtrl.setRoot(AllConversationsPage);
}, 250)
});

//Redirect to messages page
// let nav = self.app.getRootNav();
// nav.setRoot(AllMessagesPage);
}, function(error) {

//Error
8 changes: 6 additions & 2 deletions client/secureChatIonic/app/providers/app-auth/app-auth.ts
Original file line number Diff line number Diff line change
@@ -4,6 +4,9 @@ import { App } from 'ionic-angular';
import 'rxjs/add/operator/map';
import {Observable} from 'rxjs/Observable';

//pages
import { Home } from '../../pages/home/home';

//Import our providers (services)
import { AppSettings } from '../../providers/app-settings/app-settings';
import { AppNotify } from '../../providers/app-notify/app-notify';
@@ -104,8 +107,9 @@ export class AppAuth {
});

//Redirect to messages page
// let nav = this.app.getRootNav();
// nav.setRoot(Home);
//Force the user to the login page
let nav = this.app.getRootNav();
nav.setRoot(Home);
}


Original file line number Diff line number Diff line change
@@ -70,6 +70,7 @@ export class AppNotify {
localStorage.setItem(AppSettings.shushItemName, JSON.stringify(user))

//Force the user to the login page
//Will Create circular dependency, need to create pages provider
// let nav = this.app.getRootNav();
// nav.setRoot(AuthLoginPage);