Explorar el Código

Link to changelog from version update alert dialog (#363)

When notifying the user about a new version of Threema Web, link to the
changelog.
Danilo Bargen hace 7 años
padre
commit
5badc772b6
Se han modificado 3 ficheros con 9 adiciones y 4 borrados
  1. 1 1
      public/i18n/de.json
  2. 1 1
      public/i18n/en.json
  3. 7 2
      src/services/version.ts

+ 1 - 1
public/i18n/de.json

@@ -232,7 +232,7 @@
     },
     "version": {
         "NEW_VERSION": "Neue Version Verfügbar",
-        "NEW_VERSION_BODY": "Eine neue Version von Threema Web ({version}) ist verfügbar. Drücken Sie \"OK\" um die Seite neu zu laden."
+        "NEW_VERSION_BODY": "Eine neue Version von Threema Web ({version}) ist verfügbar. Mehr Informationen finden Sie im {changelog}. Drücken Sie \"OK\" um das Update zu aktivieren."
     },
     "voip": {
         "CALL_MISSED": "Verpasster Anruf",

+ 1 - 1
public/i18n/en.json

@@ -232,7 +232,7 @@
     },
     "version": {
         "NEW_VERSION": "New Version Available",
-        "NEW_VERSION_BODY": "A new version of Threema Web ({version}) is available. Click \"OK\" to reload the page."
+        "NEW_VERSION_BODY": "A new version of Threema Web ({version}) is available. Check out the {changelog} for more information. Click \"OK\" to activate the update."
     },
     "voip": {
         "CALL_MISSED": "Missed call",

+ 7 - 2
src/services/version.ts

@@ -119,9 +119,14 @@ export class VersionService {
             // Don't show again if dialog is already showing.
             return;
         }
+        const changelogUrl = 'https://github.com/threema-ch/threema-web/blob/master/CHANGELOG.md';
+        const changelogLink = '<a href="' + changelogUrl + '" target="_blank">Changelog</a>';
         const confirm = this.$mdDialog.alert()
-            .title(this.$translate.instant('version.NEW_VERSION', {version: version}))
-            .textContent(this.$translate.instant('version.NEW_VERSION_BODY', {version: version}))
+            .title(this.$translate.instant('version.NEW_VERSION'))
+            .htmlContent(this.$translate.instant('version.NEW_VERSION_BODY', {
+                version: version,
+                changelog: changelogLink,
+            }))
             .ok(this.$translate.instant('common.OK'));
         this.dialogShowing = true;
         this.$mdDialog.show(confirm).then(() => {