Skip to content

Commit

Permalink
Further tweaks to reconnect screens
Browse files Browse the repository at this point in the history
  • Loading branch information
threema-danilo committed May 17, 2022
1 parent baf8bb1 commit f5bb696
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions public/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"PLEASE_SCAN": "Scan this QR code with your Threema app",
"PLEASE_SCAN_INSTRUCTIONS": "Android: Menu > Desktop/Web | iOS: Settings > Desktop/Web",
"PLEASE_UNLOCK": "Session closed",
"PLEASE_START_APP": "Please start the Threema app",
"WAITING": "Waiting for connection",
"RETRY": "Retry",
"PLEASE_RELOAD": "Please reload the page to try again.",
Expand All @@ -34,7 +35,7 @@
"CONNECTING": "Connecting",
"WAITING_FOR_PUSH": "Waiting for<br>app wakeup …",
"CONNECTING_TO_APP": "Connection to app is<br>being established …",
"WAITING_FOR_APP": "Waiting for Threema app<br>to be started on your phone …",
"WAITING_FOR_APP": "Waiting for Threema<br>to be started on your phone …",
"LOADING_INITIAL_DATA": "Loading initial data …",
"MANUAL_START": "Please start your session",
"MANUAL_START_TEXT1": "Push service is not available. Are Google Play Services installed on your mobile device?",
Expand Down Expand Up @@ -64,15 +65,14 @@
},
"troubleshooting": {
"SLOW_CONNECT": "Connecting seems to take longer than usual …",
"PLEASE_START_APP": "Please start the Threema app",
"APP_STARTED": "Is the Threema app started?",
"APP_STARTED_AND_VISIBLE": "Is the Threema app started and visible?",
"SESSION_DELETED": "Did you delete this session on your phone?",
"PHONE_ONLINE": "Is your phone connected to the internet?",
"UNLOCK_OR_CHARGE": "It may help to unlock your device or connect it to a charger.",
"PUSH_FAQ": "Your device may be affected by Push Notification issues. See the FAQ articles for <a target=\"_blank\" href=\"https://threema.ch/faq/push_andr\">Android</a> and <a target=\"_blank\" href=\"https://threema.ch/faq/push_ios\">iOS</a> for troubleshooting.",
"PUSH_FAQ_IOS_FOREGROUND": "For more information about Threema Web on iOS, see <a href=\"{faqUrl}\">this FAQ entry</a>.",
"WEBCLIENT_ENABLED": "Is Threema Desktop/Web enabled in the Threema app?",
"PUSH_FAQ": "Your device may be affected by Push Notification issues. See the FAQ articles for <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://threema.ch/faq/push_andr\">Android</a> and <a target=\"_blank\" href=\"https://threema.ch/faq/push_ios\">iOS</a> for troubleshooting.",
"PUSH_FAQ_IOS_FOREGROUND": "For more information about using Desktop/Web together with iOS, see <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"{faqUrl}\">this FAQ entry</a>.",
"WEBCLIENT_ENABLED": "Is Desktop/Web enabled in the Threema app?",
"PLUGIN": "Is a privacy plugin installed in your browser which blocks WebRTC communication?",
"ADBLOCKER": "Do you use an ad blocker which also blocks WebRTC communication?",
"PLEASE_UPDATE_APP": "Please make sure that you're using the <a href=\"https://threema.ch/en/whats-new\" target=\"_blank\">latest version</a> of the Threema app!",
Expand Down
2 changes: 1 addition & 1 deletion src/partials/dialog.device-unreachable.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h2 translate>deviceUnreachable.DEVICE_UNREACHABLE</h2>
</md-toolbar>
<md-dialog-content>
<div class="md-dialog-content">
<h3 translate>deviceUnreachable.UNABLE_TO_CONNECT</h3>
<h3 translate style="margin-bottom: 12px;">deviceUnreachable.UNABLE_TO_CONNECT</h3>
<ul class="material-icons-list" ng-if="ctrl.highPriorityPushes">
<li class="help">
<span translate>troubleshooting.PHONE_ONLINE</span>
Expand Down
15 changes: 8 additions & 7 deletions src/partials/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,20 @@ <h2 class="instructions" translate>welcome.PLEASE_UNLOCK</h2>
</div>

<div ng-if="ctrl.showLoadingIndicator">
<h2 class="instructions" translate>welcome.CONNECTING</h2>
<h2 class="instructions" translate ng-if="ctrl.state !== 'push' || !ctrl.hasAppleNonVoipPushToken()">welcome.CONNECTING</h2>
<h2 class="instructions" translate ng-if="ctrl.state === 'push' && ctrl.hasAppleNonVoipPushToken()">welcome.PLEASE_START_APP</h2>
<div class="loading">
<md-progress-circular md-mode="determinate" value="{{ ctrl.progress }}" md-diameter="250" ng-aria-disable>
</md-progress-circular>
<div class="info" aria-live="polite" ng-aria-disable>
<p class="percentage">{{ ctrl.progress }}%</p>
<p ng-if="ctrl.state === 'push'" translate>welcome.WAITING_FOR_PUSH</p>
<p ng-if="ctrl.state === 'peer_handshake' && ctrl.highPriorityPushes" translate>welcome.CONNECTING_TO_APP</p>
<p ng-if="ctrl.state === 'peer_handshake' && !ctrl.highPriorityPushes" translate>welcome.WAITING_FOR_APP</p>
<p ng-if="ctrl.state === 'push' && !ctrl.hasAppleNonVoipPushToken()" translate>welcome.WAITING_FOR_PUSH</p>
<p ng-if="ctrl.state === 'push' && ctrl.hasAppleNonVoipPushToken()" translate>welcome.WAITING_FOR_APP</p>
<p ng-if="ctrl.state === 'peer_handshake'" translate>welcome.CONNECTING_TO_APP</p>
<p ng-if="ctrl.state === 'loading' || ctrl.state === 'done'" translate>welcome.LOADING_INITIAL_DATA</p>

<!-- Troubleshooting: High-priority pushes (FCM & APNs VoIP) -->
<div class="troubleshoot" ng-if="ctrl.slowConnect && ctrl.highPriorityPushes">
<div class="troubleshoot" ng-if="ctrl.slowConnect && !ctrl.hasAppleNonVoipPushToken()">
<h3 translate>troubleshooting.SLOW_CONNECT</h3>
<ul class="material-icons-list">
<li class="help">
Expand Down Expand Up @@ -121,7 +122,7 @@ <h3 translate>troubleshooting.SLOW_CONNECT</h3>
</div>

<!-- Troubleshooting: Non high-priority pushes (APNs Non-VoIP) -->
<div class="troubleshoot" ng-if="ctrl.slowConnect && !ctrl.highPriorityPushes">
<div class="troubleshoot" ng-if="ctrl.slowConnect && ctrl.hasAppleNonVoipPushToken()">
<h3 translate>troubleshooting.SLOW_CONNECT</h3>
<ul class="material-icons-list">
<li ng-if="ctrl.state === 'push'" class="help">
Expand All @@ -137,7 +138,7 @@ <h3 translate>troubleshooting.SLOW_CONNECT</h3>
<span translate>troubleshooting.SESSION_DELETED</span>
</li>
<li ng-if="ctrl.state === 'push'" class="info">
<span translate translate-values="{'faqUrl': 'https://threema.ch/en/faq/web_ios_foreground'}">troubleshooting.PUSH_FAQ_IOS_FOREGROUND</span>
<span translate translate-values="{'faqUrl': 'https://threema.ch/faq/web_ios_foreground'}">troubleshooting.PUSH_FAQ_IOS_FOREGROUND</span>
</li>
</ul>
<md-button role="button" class="md-raised md-primary reload-btn" ng-click="ctrl.deleteSession()" ng-if="ctrl.state === 'push'" aria-labelledby="aria-label-forget">
Expand Down
8 changes: 4 additions & 4 deletions src/partials/welcome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ class WelcomeController {
private browser: BrowserInfo;
private browserWarningShown: boolean = false;
private inMemorySession: InMemorySession = new InMemorySession();
public highPriorityPushes: boolean;

public static $inject = [
'$scope', '$state', '$window', '$mdDialog', '$translate',
Expand Down Expand Up @@ -199,9 +198,6 @@ class WelcomeController {
}
}

// Determine push type
this.highPriorityPushes = !this.webClientService.hasAppleNonVoipPushToken();

// Clear cache
this.webClientService.clearCache();

Expand Down Expand Up @@ -730,6 +726,10 @@ class WelcomeController {
public reload() {
this.$window.location.reload();
}

public hasAppleNonVoipPushToken() {
return this.webClientService.hasAppleNonVoipPushToken();
}
}

angular.module('3ema.welcome', [])
Expand Down
5 changes: 2 additions & 3 deletions src/sass/sections/_welcome.scss
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,10 @@
}

.troubleshoot {
margin-top: calc(#{$progress-overlap} + 40px);
margin-top: 90px;

h3 {
margin-bottom: 8px;
height: 44px;
height: 32px;
}

ul {
Expand Down

0 comments on commit f5bb696

Please sign in to comment.