Display the error when opening a document with the wrong app

This commit is contained in:
yflory 2017-02-06 12:43:56 +01:00
parent 6f0d33dc1d
commit 7e7d1f7a16
4 changed files with 9 additions and 2 deletions

View File

@ -22,7 +22,9 @@ define(function () {
].join('');
out.common_connectionLost = "<b>Connexion au serveur perdue</b><br>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";

View File

@ -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";

View File

@ -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;

View File

@ -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) {