From 7e7d1f7a160c028f68fca139af6b5e9cf741f8f3 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 6 Feb 2017 12:43:56 +0100 Subject: [PATCH] Display the error when opening a document with the wrong app --- customize.dist/translations/messages.fr.js | 2 ++ customize.dist/translations/messages.js | 1 + www/code/main.js | 4 +++- www/slide/main.js | 4 +++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index dd646bc5d..9e738720b 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -22,7 +22,9 @@ define(function () { ].join(''); out.common_connectionLost = "Connexion au serveur perdue
Vous êtes désormais en mode lecture seule jusqu'au retour de la connexion."; + out.websocketError = 'Impossible de se connecter au serveur WebSocket...'; + out.typeError = "Ce document temps-réel n'est pas compatible avec l'application sélectionnée"; out.loading = "Chargement..."; out.error = "Erreur"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index cfdfde7d4..4f53c1a00 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -28,6 +28,7 @@ define(function () { out.common_connectionLost = out.updated_common_connectionLostAndInfo; out.websocketError = 'Unable to connect to the websocket server...'; + out.typeError = "That realtime document is not compatible with the selected application"; out.loading = "Loading..."; out.error = "Error"; diff --git a/www/code/main.js b/www/code/main.js index 8595d3b2e..2e9d2f97b 100644 --- a/www/code/main.js +++ b/www/code/main.js @@ -558,7 +558,9 @@ define([ var hjson = JSON.parse(userDoc); if (typeof (hjson) !== 'object' || Array.isArray(hjson)) { - throw new Error("That realtime document is not compatible with the Code app"); + var errorText = Messages.typeError; + Cryptpad.errorLoadingScreen(errorText); + throw new Error(errorText); } newDoc = hjson.content; diff --git a/www/slide/main.js b/www/slide/main.js index 28b6d93e1..e903ea018 100644 --- a/www/slide/main.js +++ b/www/slide/main.js @@ -631,7 +631,9 @@ define([ newDoc = hjson.content; if (typeof (hjson) !== 'object' || Array.isArray(hjson)) { - throw new Error("That realtime document is not compatible with the Slide app"); + var errorText = Messages.typeError; + Cryptpad.errorLoadingScreen(errorText); + throw new Error(errorText); } if (hjson.highlightMode) {