1616<script >
1717import { invoke } from " @tauri-apps/api/core" ;
1818import {onMount } from ' svelte' ;
19+ import { getVersion } from ' @tauri-apps/api/app' ;
20+
21+ let appVersion;
22+
1923
2024onMount (async () => {
2125 console .log (" onMount() starting dweb server..." );
26+ appVersion = await getVersion ();
2227 await startServer ();
2328 await refreshWallet ();
2429});
@@ -90,6 +95,13 @@ async function refreshWallet() {
9095 walletAddress = data .wallet_address || " " ;
9196 antBalance = data .ant_balance || " " ;
9297 ethBalance = data .eth_balance || " " ;
98+
99+ // If a random wallet, hide the address to prevent user sending funds to it
100+ if (antBalance == 0 && ethBalance == 0 ) {
101+ walletAddress = " no wallet found on device"
102+ antBalance = " -"
103+ ethBalance = " -"
104+ }
93105 walletLoading = false ;
94106 return ;
95107 }
@@ -118,26 +130,26 @@ async function refreshWallet() {
118130 </div >
119131 </div >
120132
121- <h1 >Autonomi dweb <a href =" https://codeberg.org/happybeing/dweb#dweb" target =" _blank" >
133+ <h1 >AutonomiDweb <a href =" https://codeberg.org/happybeing/dweb#dweb" target =" _blank" >
122134 <img src =" /dweb-logo.svg" class =" logo dweb" alt =" dweb Logo" />
123135 </a >
124- </h1 >
125-
126- <div class =" row" >
127- </div >
136+ </h1 >
137+ v{appVersion }
128138
129- <p ><button onclick ={browseAutonomi }>Browse Autonomi dweb</button ></p >
130- <p >Explore the secure peer-to-peer web on the Autonomi network</p >
139+ <p >
140+ <button title ="Explore the secure web on Autonomi" onclick ={browseAutonomi }>Browse the Autonomi dweb</button >
141+ </p >
131142
143+ Or open a website you know...<br />
132144 <div class =" open-input" >
133145 <input
134146 type =" text"
135147 bind:value ={openAddress }
136- placeholder =" Open dweb app via address or name"
148+ placeholder =" Enter an address or name to open "
137149 onkeydown ={handleEnter }
138- aria-label =" Open dweb app via address or name"
150+ aria-label =" Enter an address or name to open "
139151 />
140- <button onclick ={openByAddress }>Open</button >
152+ <button title = "Go directly to a website or app" onclick ={openByAddress }>Open</button >
141153 </div >
142154</main >
143155
@@ -206,7 +218,7 @@ async function refreshWallet() {
206218}
207219
208220.open-input {
209- margin-top : 1 rem ;
221+ margin-top : 0 ;
210222 display : inline-flex ;
211223 gap : 0.5rem ;
212224 align-items : center ;
@@ -232,9 +244,11 @@ a:hover {
232244
233245h1 {
234246 text-align : center ;
247+ margin-bottom : 0 ;
235248}
236249
237250button {
251+ margin-top : 0 ;
238252 border-radius : 8px ;
239253 border : 1px solid transparent ;
240254 padding : 0.6em 1.2em ;
0 commit comments