You've already forked AstralRinth
forked from didirus/AstralRinth
Implement loading (#104)
* Implement loading * LoadingBar * Run linter * Update App.vue * Loading bar all the things * Update SplashScreen.vue * Update SplashScreen.vue * Update App.vue * initial revert * Update Instance.vue * revert css * Fix instance * More reverting * Run lint * Finalize changes * Revert "Merge branch 'master' into loading" This reverts commit 3014e765fb6fb343f3030fd8a822edd97fb2af41, reversing changes made to b780e859d2b53a203eb3561ba3be88af083d9c15. * Fix loading issues * fix lint * Revert "Revert "Merge branch 'master' into loading"" This reverts commit 971ef8466613579b7f523edbd25b692df62d0f86. --------- Co-authored-by: Jai A <jaiagr+gpg@pm.me>
This commit is contained in:
@@ -4,6 +4,7 @@ import GridDisplay from '@/components/GridDisplay.vue'
|
||||
import { list } from '@/helpers/profile.js'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useBreadcrumbs } from '@/store/breadcrumbs'
|
||||
import { loading_listener } from '@/helpers/events.js'
|
||||
|
||||
const route = useRoute()
|
||||
const breadcrumbs = useBreadcrumbs()
|
||||
@@ -17,12 +18,21 @@ const instances = shallowRef(
|
||||
const modpacks = shallowRef(
|
||||
Object.values(profiles).filter((prof) => prof.metadata.linked_project_id)
|
||||
)
|
||||
|
||||
loading_listener(async (profile) => {
|
||||
console.log(profile)
|
||||
if (profile.event === 'loaded') {
|
||||
const profiles = await list()
|
||||
instances.value = Object.values(profiles).filter((prof) => !prof.metadata.linked_project_id)
|
||||
modpacks.value = Object.values(profiles).filter((prof) => prof.metadata.linked_project_id)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<GridDisplay label="Instances" :instances="instances" />
|
||||
<GridDisplay label="Modpacks" :instances="modpacks" />
|
||||
<GridDisplay v-if="instances.length > 0" label="Instances" :instances="instances" />
|
||||
<GridDisplay v-if="modpacks.length > 0" label="Modpacks" :instances="modpacks" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user