summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-02-06 16:40:42 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-02-06 16:40:42 +0900
commitaf27ea8a5e5745f1f250b6599b829293063242bd (patch)
treecdfb6ce8df67081fc24142758ecf03818a08093c /src
parent[Client] Sticky icons (diff)
downloadmisskey-af27ea8a5e5745f1f250b6599b829293063242bd.tar.gz
misskey-af27ea8a5e5745f1f250b6599b829293063242bd.tar.bz2
misskey-af27ea8a5e5745f1f250b6599b829293063242bd.zip
[Client] Fix bug
Diffstat (limited to 'src')
-rw-r--r--src/web/app/boot.js28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/web/app/boot.js b/src/web/app/boot.js
index ba4ed5ff4e..2eca91ebd4 100644
--- a/src/web/app/boot.js
+++ b/src/web/app/boot.js
@@ -38,9 +38,6 @@ try {
// Check for Update
checkForUpdate();
-// Get token from cookie
-const i = (document.cookie.match(/i=(!\w+)/) || [null, null])[1];
-
// ユーザーをフェッチしてコールバックする
module.exports = callback => {
// Get cached account data
@@ -50,7 +47,7 @@ module.exports = callback => {
fetched(cachedMe);
// 後から新鮮なデータをフェッチ
- fetchme(i, true, freshData => {
+ fetchme(cachedMe.token, freshData => {
Object.assign(cachedMe, freshData);
cachedMe.trigger('updated');
});
@@ -60,7 +57,10 @@ module.exports = callback => {
localStorage.removeItem('me');
}
- fetchme(i, false, fetched);
+ // Get token from cookie
+ const i = (document.cookie.match(/i=(!\w+)/) || [null, null])[1];
+
+ fetchme(i, fetched);
}
function fetched(me) {
@@ -100,7 +100,7 @@ module.exports = callback => {
};
// ユーザーをフェッチしてコールバックする
-function fetchme(token, silent, cb) {
+function fetchme(token, cb) {
let me = null;
// Return when not signed in
@@ -132,15 +132,13 @@ function fetchme(token, silent, cb) {
init();
}
});
- }).catch(() => {
- if (!silent) {
- const info = document.body.appendChild(document.createElement('mk-core-error'));
- riot.mount(info, {
- retry: () => {
- fetchme(token, false, cb);
- }
- });
- }
+ }, () => {
+ const info = document.body.appendChild(document.createElement('mk-core-error'));
+ riot.mount(info, {
+ retry: () => {
+ fetchme(token, cb);
+ }
+ });
});
function done() {