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)
2828const featurePreviewMode = ref (false )
2929const isWalletAvailable = ref (false )
3030
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 () => {
3240 featurePreviewMode .value = localStorage .featurePreview
3341 isWalletAvailable .value = !! window .keplr
3442})
@@ -73,8 +81,10 @@ const handleNavigate = (url) => {
7381 window .location .replace (url)
7482}
7583
76- const handleConnect = () => {
77- window .keplr .enable (" celestia" )
84+ const handleConnect = async () => {
85+ await window .keplr .enable (" celestia" )
86+
87+ getAccounts ()
7888}
7989 </script >
8090
@@ -154,8 +164,14 @@ const handleConnect = () => {
154164 </template >
155165 </Tooltip >
156166
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" }}
159175 </Button >
160176 </Flex >
161177 </Flex >
You can’t perform that action at this time.
0 commit comments