Skip to content

Commit

Permalink
Add force reconnect button
Browse files Browse the repository at this point in the history
  • Loading branch information
melonmanchan committed Mar 3, 2016
1 parent fa669aa commit 42a6c8b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
7 changes: 6 additions & 1 deletion app/js/services/peerhandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ peerhandler.factory('peerFactory', function(configFactory, $rootScope, $ionicPop
reconnectScope.stopTimer = function () {
clearTimeout(reconnectScope.countdownTimer);
};

reconnectScope.forceReconnect = function () {
me.reconnect();
};

// Array of callback functions to handle data
var dataCallbacks = [];

Expand Down Expand Up @@ -314,7 +319,7 @@ peerhandler.factory('peerFactory', function(configFactory, $rootScope, $ionicPop

var attemptReconnect = function () {

if (me && me.disconnected === true ) {
if (me && me.disconnected === true && me.open === false ) {
console.log('attempting to reconnect...');
me.reconnect();
reconnectAttempts = reconnectAttempts + 1;
Expand Down
3 changes: 2 additions & 1 deletion app/res/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@
"DIAL_WAIT": "Dialing, please hold...",
"DISPLAY_NAME": "Display name",
"ERROR" : "Error!",
"ERROR_FETCH_CONTACTS": "Failed to fetch contacts",
"ERROR_NETWORK" : "Network error with server!",
"ERROR_SERVER" : "Could not connect to server!",
"ERROR_TITLE" : "Something went wrong!",
"ERROR_USER_OFFLINE": "Looks like that user is offline!",
"FORCE_RECONNECT": "Try again now",
"LOGIN": "Log in",
"LOG_OUT": "Log out",
"LOST_PASSWORD": " Lost password?",
"MALFORMED_NUMBER": "Your number seems to not be valid!",
"MISCALLENEOUS": "Miscellaneous",
"MOBILE_NUMBER": "Mobile number",
"ERROR_FETCH_CONTACTS": "Failed to fetch contacts",
"MOBILE_NUMBER_EXAMPLE": "eg. +358 40 123456",
"NEXT_RECONNECT_IN": "Next attempt in {{countdown}} seconds...",
"NOTIFICATION_CALL" : "SoAR call from {{displayName}} ( {{mediaConnection}} )",
Expand Down
3 changes: 2 additions & 1 deletion app/res/locales/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
"DIAL_WAIT": "Soitetaan, odota hetki...",
"DISPLAY_NAME": "Nimi",
"ERROR" : "Virhe!",
"ERROR_FETCH_CONTACTS": "Kontaktien haku ei onnistunut.",
"ERROR_NETWORK" : "Yhteysvirhe palvelimen kanssa",
"ERROR_SERVER" : "Palvelimeen ei saatu yhteyttä!",
"ERROR_TITLE" : "Jotain meni pieleen!",
"ERROR_USER_OFFLINE": "Näyttää siltä että käyttäjä on offline!",
"FORCE_RECONNECT": "Kokeile uudelleen heti",
"LOGIN" : "Kirjaudu sisään",
"LOG_OUT": "Kirjaudu ulos",
"LOST_PASSWORD": "Unohditko salasanasi?",
Expand All @@ -24,7 +26,6 @@
"MOBILE_NUMBER": "Puhelinnumero",
"MOBILE_NUMBER_EXAMPLE": "Esim. +358 40 123456",
"NEXT_RECONNECT_IN": "Seuraava yritys {{countdown}} sekunnissa...",
"ERROR_FETCH_CONTACTS": "Kontaktien haku ei onnistunut.",
"NOTIFICATION_CALL" : "SoAR-puhelu {{displayName}}:lta ( {{mediaConnection}} )",
"NO_CONTACTS_FOUND": "Näyttää siltä, että sinulla ei ole SoAR:n asentaneita kontakteja puhelimellasi",
"NO_CONTACTS_SEARCH": "Ei vastaavia kontakteja",
Expand Down
1 change: 1 addition & 0 deletions app/templates/modals/reconnect-loader.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<h1>{{'RECONNECT_STARTED' | translate}}</h1>
<h2 translate="NEXT_RECONNECT_IN" translate-values="{countdown: countdown}"></h2>
<ion-spinner class="call-loader"></ion-spinner>
<button ng-click="forceReconnect()" class="button button-block button-positive" translate="FORCE_RECONNECT"></button>

0 comments on commit 42a6c8b

Please sign in to comment.