File tree Expand file tree Collapse file tree 1 file changed +21
-5
lines changed Expand file tree Collapse file tree 1 file changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,15 @@ const head = computed(() => appStore.head)
28
28
const featurePreviewMode = ref (false )
29
29
const isWalletAvailable = ref (false )
30
30
31
- onMounted (() => {
31
+ const account = ref (" " )
32
+
33
+ const getAccounts = async () => {
34
+ const offlineSigner = window .getOfflineSigner (" celestia" )
35
+ const accounts = await offlineSigner .getAccounts ()
36
+ if (accounts .length ) account .value = accounts[0 ].address
37
+ }
38
+
39
+ onMounted (async () => {
32
40
featurePreviewMode .value = localStorage .featurePreview
33
41
isWalletAvailable .value = !! window .keplr
34
42
})
@@ -73,8 +81,10 @@ const handleNavigate = (url) => {
73
81
window .location .replace (url)
74
82
}
75
83
76
- const handleConnect = () => {
77
- window .keplr .enable (" celestia" )
84
+ const handleConnect = async () => {
85
+ await window .keplr .enable (" celestia" )
86
+
87
+ getAccounts ()
78
88
}
79
89
</script >
80
90
@@ -154,8 +164,14 @@ const handleConnect = () => {
154
164
</template >
155
165
</Tooltip >
156
166
157
- <Button v-if =" featurePreviewMode" @click =" handleConnect" type =" white" size =" small" :disabled =" !isWalletAvailable" >
158
- Connect
167
+ <Button
168
+ v-if =" featurePreviewMode"
169
+ @click =" handleConnect"
170
+ type =" white"
171
+ size =" small"
172
+ :disabled =" !isWalletAvailable || account.length"
173
+ >
174
+ {{ account ? `celestia...${account.slice(-6)}` : "Connect" }}
159
175
</Button >
160
176
</Flex >
161
177
</Flex >
You can’t perform that action at this time.
0 commit comments