diff --git a/hubzilla/addon/g1wallet/Widget/G1wallet.php b/hubzilla/addon/g1wallet/Widget/G1wallet.php index 1c2c809..ea32ce1 100644 --- a/hubzilla/addon/g1wallet/Widget/G1wallet.php +++ b/hubzilla/addon/g1wallet/Widget/G1wallet.php @@ -3,78 +3,52 @@ namespace Zotlabs\Widget; /** - * G1wallet — sidebar wallet status widget. - * Shows locked/unlocked state, first 12 chars of pubkey, and cached balance. - * At skeleton stage: always shows locked (JS session detection not yet wired). - * Once g1wallet.js is implemented, it dispatches 'g1wallet:unlocked' and - * 'g1wallet:locked' events that this widget's JS listener updates the DOM for. + * G1wallet — sidebar widget. + * Shows the participant's registered Ğ1 address (short) and cached balance. + * Links to /g1wallet for registration or update. + * No JS session state — all server-side. */ class G1wallet { public function widget($arr) { $wallet_url = z_root() . '/g1wallet'; - // Retrieve cached pubkey and balance from channel settings if available. - // These are set by g1wallet_handle_pubkey_post() and the balance refresh flow. - $cached_pubkey = ''; + $stored_address = ''; $cached_balance = ''; if (local_channel()) { - $cached_pubkey = get_pconfig(local_channel(), 'g1wallet', 'g1_pubkey') ?: ''; + $stored_address = get_pconfig(local_channel(), 'g1wallet', 'g1_address') ?: ''; $cached_balance = get_pconfig(local_channel(), 'g1wallet', 'g1_balance') ?: ''; } - $uid = 'g1wallet-widget-' . substr(md5(uniqid()), 0, 6); - - $out = '