From bbb2650032efd950ba1d225b59aaf4ea89a81e82 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 11 Jun 2017 21:26:09 +0900 Subject: [PATCH] [Client] Improve error screen rendering --- locales/en.yml | 2 +- src/web/app/common/tags/error.tag | 35 ++++++++++++++++--------------- src/web/app/init.js | 8 ++++--- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/locales/en.yml b/locales/en.yml index e15a7c9ae..9cc5df317 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -52,7 +52,7 @@ common: no-apps: "No apps" mk-error: - title: "Cannot connect to the server" + title: "Unable to connect to the server" description: "インターネット回線に問題があるか、サーバーがダウンまたはメンテナンスしている可能性があります。しばらくしてから再度お試しください。" thanks: "Thank you for using Misskey." diff --git a/src/web/app/common/tags/error.tag b/src/web/app/common/tags/error.tag index c7491d1c4..bbf796232 100644 --- a/src/web/app/common/tags/error.tag +++ b/src/web/app/common/tags/error.tag @@ -1,36 +1,25 @@ -

%i18n:common.tags.mk-error.title%

%i18n:common.tags.mk-error.description%

%i18n:common.tags.mk-error.thanks%

+
diff --git a/src/web/app/init.js b/src/web/app/init.js index b442d36a1..825bbc77e 100644 --- a/src/web/app/init.js +++ b/src/web/app/init.js @@ -9,6 +9,7 @@ import api from './common/scripts/api'; import signout from './common/scripts/signout'; import checkForUpdate from './common/scripts/check-for-update'; import Connection from './common/scripts/home-stream'; +import Progress from './common/scripts/loading'; import mixin from './common/mixins'; import generateDefaultUserdata from './common/scripts/generate-default-userdata'; import CONFIG from './common/scripts/config'; @@ -147,9 +148,10 @@ function fetchme(token, cb) { me.data ? done() : init(); }); }, () => { // When failure - // Display error screen - riot.mount(document.body.appendChild( - document.createElement('mk-error'))); + // Render the error screen + document.body.innerHTML = ''; + riot.mount('*'); + Progress.done(); }); function done() {