-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathRootLayout.vue
61 lines (50 loc) · 1.18 KB
/
RootLayout.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<template>
<div
:class="[
'flex',
'flex-col',
'min-h-screen',
'text-dark-gray',
bgClass,
]"
>
<slot />
<AlertsChainUpgrading
v-model="isOpenChainUpgradeBlockingDialog"
@close="isOpenChainUpgradeBlockingDialog"
/>
<DialogContainer>
<Dialog />
</DialogContainer>
</div>
</template>
<script lang="ts">
import { Vue, Component, Prop } from 'vue-property-decorator'
import { namespace } from 'vuex-class'
import { IS_CHAIN_UPGRADING } from '~/constant'
const bookApiModule = namespace('book-api')
@Component({
head() {
return {
htmlAttrs: {
class: this.$props.bgClass,
},
}
},
})
export default class RootLayout extends Vue {
@bookApiModule.Action('restoreSession') restoreSession!: () => void
@Prop({ default: 'bg-light-gray' }) readonly bgClass!: string
isOpenChainUpgradeBlockingDialog = false
async mounted() {
this.isOpenChainUpgradeBlockingDialog = !!IS_CHAIN_UPGRADING
await this.restoreSession()
}
handleChainUpgradeBlockingDialogClose() {
this.isOpenChainUpgradeBlockingDialog = false
}
handleKeplrWarningClose() {
this.$router.go(-1)
}
}
</script>