Skip to content

Commit

Permalink
fix start loader
Browse files Browse the repository at this point in the history
  • Loading branch information
vol4tim committed Mar 12, 2024
1 parent e6ecaff commit 4af2c1a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<template>
<main-layout :title="title">
<template v-if="isReady">
<router-view />
</template>
<robo-layout-section v-else gcenter>
<main-layout v-if="isReady" :title="title">
<router-view />
</main-layout>
<loader-layout v-else :title="title">
<robo-layout-section gcenter>
<robo-loader size="2" />
</robo-layout-section>
</main-layout>
</loader-layout>
</template>

<script>
import LoaderLayout from "@/components/layouts/Loader.vue";
import MainLayout from "@/components/layouts/Main.vue";
import { inject, ref, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
Expand All @@ -18,6 +19,7 @@ import { useStore } from "vuex";
export default {
name: "App",
components: {
LoaderLayout,
MainLayout
},
setup() {
Expand Down
3 changes: 3 additions & 0 deletions src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ export default {
},
methods: {
async handlerAccount(address) {
if (!this.RobonomicsProvider.isReady.value) {
return;
}
if (this.unsubscribeBalance) {
this.unsubscribeBalance();
}
Expand Down
16 changes: 16 additions & 0 deletions src/components/layouts/Loader.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<template>

Check warning on line 1 in src/components/layouts/Loader.vue

View workflow job for this annotation

GitHub Actions / deploy

Component name "Loader" should always be multi-word
<robo-layout>
<dapp-header :title="title" />
<slot />
</robo-layout>
</template>

<script>
import DappHeader from "@/components/Header";
export default {
components: {
DappHeader
}
};
</script>

0 comments on commit 4af2c1a

Please sign in to comment.