Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pleroma-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Ilja
pleroma-fe
Commits
8fc10dc1
Commit
8fc10dc1
authored
6 years ago
by
jasper
Browse files
Options
Downloads
Patches
Plain Diff
Add Promise.all to send requests when loading
parent
0117f6af
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/boot/after_store.js
+28
-11
28 additions, 11 deletions
src/boot/after_store.js
with
28 additions
and
11 deletions
src/boot/after_store.js
+
28
−
11
View file @
8fc10dc1
...
...
@@ -219,6 +219,15 @@ const getNodeInfo = async ({ store }) => {
}
}
const
setConfig
=
async
({
store
})
=>
{
// apiConfig, staticConfig
const
configInfos
=
await
Promise
.
all
([
getStatusnetConfig
({
store
}),
getStaticConfig
()])
const
apiConfig
=
configInfos
[
0
]
const
staticConfig
=
configInfos
[
1
]
await
setSettings
({
store
,
apiConfig
,
staticConfig
})
}
const
afterStoreSetup
=
async
({
store
,
i18n
})
=>
{
if
(
store
.
state
.
config
.
customTheme
)
{
// This is a hack to deal with async loading of config.json and themes
...
...
@@ -230,18 +239,26 @@ const afterStoreSetup = async ({ store, i18n }) => {
})
}
const
apiConfig
=
await
getStatusnetConfig
({
store
})
const
staticConfig
=
await
getStaticConfig
()
await
setSettings
({
store
,
apiConfig
,
staticConfig
})
await
getTOS
({
store
})
await
getInstancePanel
({
store
})
await
getStaticEmoji
({
store
})
await
getCustomEmoji
({
store
})
await
getNodeInfo
({
store
})
// Now we have the server settings and can try logging in
// Now we can try getting the server settings and logging in
if
(
store
.
state
.
oauth
.
token
)
{
await
store
.
dispatch
(
'
loginUser
'
,
store
.
state
.
oauth
.
token
)
await
Promise
.
all
([
setConfig
({
store
}),
getTOS
({
store
}),
getInstancePanel
({
store
}),
getStaticEmoji
({
store
}),
getCustomEmoji
({
store
}),
getNodeInfo
({
store
}),
store
.
dispatch
(
'
loginUser
'
,
store
.
state
.
oauth
.
token
)
])
}
else
{
await
Promise
.
all
([
setConfig
({
store
}),
getTOS
({
store
}),
getInstancePanel
({
store
}),
getStaticEmoji
({
store
}),
getCustomEmoji
({
store
}),
getNodeInfo
({
store
})
])
}
const
router
=
new
VueRouter
({
...
...
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