Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
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
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
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
funkwhale
funkwhale
Commits
41edd42b
Commit
41edd42b
authored
3 years ago
by
Kasper Seweryn
Committed by
Kasper Seweryn
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Wait for all modules to load
parent
1dc6e179
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
front/src/App.vue
+0
-1
0 additions, 1 deletion
front/src/App.vue
front/src/main.ts
+19
-5
19 additions, 5 deletions
front/src/main.ts
with
19 additions
and
6 deletions
front/src/App.vue
+
0
−
1
View file @
41edd42b
...
@@ -221,5 +221,4 @@ const showSetInstanceModal = ref(false)
...
@@ -221,5 +221,4 @@ const showSetInstanceModal = ref(false)
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
@import
"style/_main"
;
@import
"style/_main"
;
</
style
>
</
style
>
This diff is collapsed.
Click to expand it.
front/src/main.ts
+
19
−
5
View file @
41edd42b
import
logger
from
'
~/logging
'
import
logger
from
'
~/logging
'
import
App
from
'
~/App.vue
'
import
router
from
'
~/router
'
import
router
from
'
~/router
'
import
VueLazyload
from
'
vue-lazyload
'
import
VueLazyload
from
'
vue-lazyload
'
import
store
from
'
~/store
'
import
store
from
'
~/store
'
...
@@ -15,21 +14,36 @@ sync(store, router)
...
@@ -15,21 +14,36 @@ sync(store, router)
const
app
=
createApp
({
const
app
=
createApp
({
store
,
store
,
router
,
router
,
render
:
(
h
:
CreateElement
)
=>
h
(
App
)
data
:
()
=>
({
isMounted
:
false
}),
async
mounted
()
{
this
.
isMounted
=
true
},
render
(
h
:
CreateElement
)
{
if
(
this
.
isMounted
)
{
return
import
(
'
~/App.vue
'
)
}
// TODO (wvffle): Import fake app component
return
h
()
}
})
})
app
.
use
(
VueCompositionAPI
)
app
.
use
(
VueCompositionAPI
)
app
.
use
(
VueLazyload
)
app
.
use
(
VueLazyload
)
const
modules
:
Promise
<
unknown
>
[]
=
[]
for
(
const
module
of
Object
.
values
(
import
.
meta
.
globEager
(
'
./modules/*.ts
'
)))
{
for
(
const
module
of
Object
.
values
(
import
.
meta
.
globEager
(
'
./modules/*.ts
'
)))
{
module
.
install
?.({
modules
.
push
(
module
.
install
?.({
app
,
app
,
router
,
router
,
store
store
})
})
)
}
}
store
.
dispatch
(
'
instance/fetchFrontSettings
'
).
finally
(()
=>
{
store
.
dispatch
(
'
instance/fetchFrontSettings
'
).
finally
(
async
()
=>
{
// Wait for all modules to load
await
Promise
.
all
(
modules
)
app
.
mount
(
'
#app
'
)
app
.
mount
(
'
#app
'
)
logger
.
default
.
info
(
'
Everything loaded!
'
)
logger
.
default
.
info
(
'
Everything loaded!
'
)
})
})
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