Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
342
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
25
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TransFem.org
Sharkey
Commits
2651612e
Commit
2651612e
authored
8 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
✌️
parent
bb507d0b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/web/app/boot.js
+8
-14
8 additions, 14 deletions
src/web/app/boot.js
with
8 additions
and
14 deletions
src/web/app/boot.js
+
8
−
14
View file @
2651612e
...
...
@@ -43,7 +43,7 @@ module.exports = callback => {
// Get cached account data
let
cachedMe
=
JSON
.
parse
(
localStorage
.
getItem
(
'
me
'
));
if
(
cachedMe
!=
null
&&
cachedMe
.
data
!=
null
&&
cachedMe
.
data
.
cache
)
{
if
(
cachedMe
&&
cachedMe
.
data
&&
cachedMe
.
data
.
cache
)
{
fetched
(
cachedMe
);
// 後から新鮮なデータをフェッチ
...
...
@@ -53,7 +53,7 @@ module.exports = callback => {
});
}
else
{
// キャッシュ無効なのにキャッシュが残ってたら掃除
if
(
cachedMe
!=
null
)
{
if
(
cachedMe
)
{
localStorage
.
removeItem
(
'
me
'
);
}
...
...
@@ -64,7 +64,7 @@ module.exports = callback => {
}
function
fetched
(
me
)
{
if
(
me
!=
null
)
{
if
(
me
)
{
riot
.
observable
(
me
);
me
.
update
=
data
=>
{
...
...
@@ -109,7 +109,7 @@ function fetchme(token, cb) {
}
// Fetch user
fetch
(
CONFIG
.
api
.
url
+
"
/i
"
,
{
fetch
(
CONFIG
.
api
.
url
+
'
/i
'
,
{
method
:
'
POST
'
,
body
:
JSON
.
stringify
({
i
:
token
...
...
@@ -125,15 +125,10 @@ function fetchme(token, cb) {
me
.
token
=
token
;
// initialize it if user data is empty
if
(
me
.
data
!=
null
)
{
done
();
}
else
{
init
();
}
me
.
data
?
done
()
:
init
();
});
},
()
=>
{
const
info
=
document
.
body
.
appendChild
(
document
.
createElement
(
'
mk-core-error
'
));
riot
.
mount
(
info
,
{
riot
.
mount
(
document
.
body
.
appendChild
(
document
.
createElement
(
'
mk-core-error
'
)),
{
retry
:
()
=>
{
fetchme
(
token
,
cb
);
}
...
...
@@ -141,9 +136,7 @@ function fetchme(token, cb) {
});
function
done
()
{
if
(
cb
!=
null
)
{
cb
(
me
);
}
if
(
cb
)
cb
(
me
);
}
function
init
()
{
...
...
@@ -160,4 +153,5 @@ function fetchme(token, cb) {
function
panic
(
e
)
{
console
.
error
(
e
);
document
.
body
.
innerHTML
=
'
<div id="error"><p>致命的な問題が発生しました。</p></div>
'
;
// TODO: Report the bug
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment