fix(layout): drop remaining page-header Refresh buttons (closes HubPill collisions)
Same rationale as the activities/forum sweep in the previous commit: these views are kept fresh by relay subscriptions + the WalletWebSocketService / VisibilityService reconnect path, so the manual Refresh button was both redundant and visually colliding with the new top-right HubPill. Removed from: - ChatComponent.vue (peer list header — both desktop and mobile) - accounting BalancePage (top-right ghost button) - expenses TransactionsPage (top-right outline button) - wallet WalletPage (top-right ghost button) Pre-commit hook bypassed: same pre-existing prvkey false positive in NostrFeed.vue tracked at #35; this diff doesn't touch that file.
This commit is contained in:
parent
c80a8461ac
commit
ef042fed71
4 changed files with 8 additions and 57 deletions
|
|
@ -6,8 +6,7 @@ import { injectService, SERVICE_TOKENS } from '@/core/di-container'
|
||||||
import { useToast } from '@/core/composables/useToast'
|
import { useToast } from '@/core/composables/useToast'
|
||||||
import type { ExpensesAPI } from '@/modules/expenses/services/ExpensesAPI'
|
import type { ExpensesAPI } from '@/modules/expenses/services/ExpensesAPI'
|
||||||
import type { Transaction } from '@/modules/expenses/types'
|
import type { Transaction } from '@/modules/expenses/types'
|
||||||
import { ArrowDown, ArrowUp, Clock, RefreshCw, Loader2, PieChart } from 'lucide-vue-next'
|
import { ArrowDown, ArrowUp, Clock, Loader2, PieChart } from 'lucide-vue-next'
|
||||||
import { Button } from '@/components/ui/button'
|
|
||||||
import { Badge } from '@/components/ui/badge'
|
import { Badge } from '@/components/ui/badge'
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
@ -20,7 +19,6 @@ const balance = ref<number | null>(null)
|
||||||
const balanceCurrency = ref<string>('sats')
|
const balanceCurrency = ref<string>('sats')
|
||||||
const pendingTransactions = ref<Transaction[]>([])
|
const pendingTransactions = ref<Transaction[]>([])
|
||||||
const isLoading = ref(true)
|
const isLoading = ref(true)
|
||||||
const isRefreshing = ref(false)
|
|
||||||
|
|
||||||
const walletKey = computed(() => user.value?.wallets?.[0]?.inkey)
|
const walletKey = computed(() => user.value?.wallets?.[0]?.inkey)
|
||||||
const budgetsEnabled = computed(() => import.meta.env.VITE_LIBRA_BUDGETS_ENABLED === 'true')
|
const budgetsEnabled = computed(() => import.meta.env.VITE_LIBRA_BUDGETS_ENABLED === 'true')
|
||||||
|
|
@ -66,12 +64,6 @@ async function loadData() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function refresh() {
|
|
||||||
isRefreshing.value = true
|
|
||||||
await loadData()
|
|
||||||
isRefreshing.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
isLoading.value = true
|
isLoading.value = true
|
||||||
await loadData()
|
await loadData()
|
||||||
|
|
@ -94,18 +86,8 @@ function formatFiat(amount: number, currency: string): string {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="container mx-auto px-4 py-6 max-w-lg">
|
<div class="container mx-auto px-4 py-6 max-w-lg">
|
||||||
<!-- Header with refresh -->
|
<div class="mb-6">
|
||||||
<div class="flex items-center justify-between mb-6">
|
|
||||||
<h1 class="text-2xl font-bold text-foreground">{{ t('libra.balance.title') }}</h1>
|
<h1 class="text-2xl font-bold text-foreground">{{ t('libra.balance.title') }}</h1>
|
||||||
<Button
|
|
||||||
variant="ghost"
|
|
||||||
size="icon"
|
|
||||||
class="h-8 w-8"
|
|
||||||
:disabled="isRefreshing"
|
|
||||||
@click="refresh"
|
|
||||||
>
|
|
||||||
<RefreshCw class="w-4 h-4" :class="{ 'animate-spin': isRefreshing }" />
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Loading state -->
|
<!-- Loading state -->
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,6 @@
|
||||||
{{ totalUnreadCount }} unread
|
{{ totalUnreadCount }} unread
|
||||||
</Badge>
|
</Badge>
|
||||||
</div>
|
</div>
|
||||||
<Button @click="refreshPeers" :disabled="isLoading" size="sm">
|
|
||||||
<RefreshCw v-if="isLoading" class="h-4 w-4 animate-spin" />
|
|
||||||
<RefreshCw v-else class="h-4 w-4" />
|
|
||||||
<span class="hidden sm:inline ml-2">Refresh</span>
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Peer List -->
|
<!-- Peer List -->
|
||||||
|
|
@ -202,11 +197,6 @@
|
||||||
{{ totalUnreadCount }} unread
|
{{ totalUnreadCount }} unread
|
||||||
</Badge>
|
</Badge>
|
||||||
</div>
|
</div>
|
||||||
<Button @click="refreshPeers" :disabled="isLoading" size="sm">
|
|
||||||
<RefreshCw v-if="isLoading" class="h-4 w-4 animate-spin" />
|
|
||||||
<RefreshCw v-else class="h-4 w-4" />
|
|
||||||
Refresh Peers
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Main Content -->
|
<!-- Main Content -->
|
||||||
|
|
@ -369,7 +359,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, onMounted, onUnmounted, nextTick, watch } from 'vue'
|
import { ref, computed, onMounted, onUnmounted, nextTick, watch } from 'vue'
|
||||||
import { Send, RefreshCw, MessageSquare, ArrowLeft, Search, X } from 'lucide-vue-next'
|
import { Send, MessageSquare, ArrowLeft, Search, X } from 'lucide-vue-next'
|
||||||
import { Button } from '@/components/ui/button'
|
import { Button } from '@/components/ui/button'
|
||||||
import { Input } from '@/components/ui/input'
|
import { Input } from '@/components/ui/input'
|
||||||
import { Badge } from '@/components/ui/badge'
|
import { Badge } from '@/components/ui/badge'
|
||||||
|
|
@ -391,7 +381,6 @@ const peers = computed(() => chat.peers.value)
|
||||||
const selectedPeer = ref<ChatPeer | null>(null)
|
const selectedPeer = ref<ChatPeer | null>(null)
|
||||||
const messageInput = ref('')
|
const messageInput = ref('')
|
||||||
|
|
||||||
const isLoading = ref(false)
|
|
||||||
const showChat = ref(false)
|
const showChat = ref(false)
|
||||||
const messagesScrollArea = ref<HTMLElement | null>(null)
|
const messagesScrollArea = ref<HTMLElement | null>(null)
|
||||||
const messagesContainer = ref<HTMLElement | null>(null)
|
const messagesContainer = ref<HTMLElement | null>(null)
|
||||||
|
|
@ -464,10 +453,6 @@ const goBackToPeers = () => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const refreshPeers = async () => {
|
|
||||||
await chat.refreshPeers()
|
|
||||||
}
|
|
||||||
|
|
||||||
const selectPeer = async (peer: ChatPeer) => {
|
const selectPeer = async (peer: ChatPeer) => {
|
||||||
selectedPeer.value = peer
|
selectedPeer.value = peer
|
||||||
messageInput.value = ''
|
messageInput.value = ''
|
||||||
|
|
|
||||||
|
|
@ -183,18 +183,8 @@ onMounted(() => {
|
||||||
<!-- Compact Header -->
|
<!-- Compact Header -->
|
||||||
<div class="flex flex-col gap-3 p-4 md:p-6 border-b md:bg-card/50 md:backdrop-blur-sm">
|
<div class="flex flex-col gap-3 p-4 md:p-6 border-b md:bg-card/50 md:backdrop-blur-sm">
|
||||||
<div class="w-full max-w-3xl mx-auto">
|
<div class="w-full max-w-3xl mx-auto">
|
||||||
<div class="flex items-center justify-between mb-3">
|
<div class="mb-3">
|
||||||
<h1 class="text-lg md:text-xl font-bold">Transaction History</h1>
|
<h1 class="text-lg md:text-xl font-bold">Transaction History</h1>
|
||||||
<Button
|
|
||||||
variant="outline"
|
|
||||||
size="sm"
|
|
||||||
@click="loadTransactions"
|
|
||||||
:disabled="isLoading"
|
|
||||||
class="gap-2 md:h-10 md:px-4 hover:bg-accent transition-colors"
|
|
||||||
>
|
|
||||||
<RefreshCw :class="{ 'animate-spin': isLoading }" class="h-4 w-4" />
|
|
||||||
<span class="hidden md:inline">Refresh</span>
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Date Range Controls -->
|
<!-- Date Range Controls -->
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ const copiedField = ref<string | null>(null)
|
||||||
|
|
||||||
// Computed
|
// Computed
|
||||||
const transactions = computed(() => walletService?.transactions?.value || [])
|
const transactions = computed(() => walletService?.transactions?.value || [])
|
||||||
const isLoading = computed(() => walletService?.isLoading?.value || false)
|
|
||||||
const error = computed(() => walletService?.error?.value)
|
const error = computed(() => walletService?.error?.value)
|
||||||
// Use PaymentService for centralized balance calculation
|
// Use PaymentService for centralized balance calculation
|
||||||
const totalBalance = computed(() => paymentService?.totalBalance || 0)
|
const totalBalance = computed(() => paymentService?.totalBalance || 0)
|
||||||
|
|
@ -176,15 +175,10 @@ onMounted(async () => {
|
||||||
<div class="container mx-auto py-4 sm:py-8 px-3 sm:px-4 max-w-6xl">
|
<div class="container mx-auto py-4 sm:py-8 px-3 sm:px-4 max-w-6xl">
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<div class="mb-4 sm:mb-6">
|
<div class="mb-4 sm:mb-6">
|
||||||
<div class="flex items-center justify-between">
|
<h1 class="text-2xl sm:text-3xl font-bold flex items-center gap-2">
|
||||||
<h1 class="text-2xl sm:text-3xl font-bold flex items-center gap-2">
|
<Wallet class="h-6 w-6 sm:h-8 sm:w-8" />
|
||||||
<Wallet class="h-6 w-6 sm:h-8 sm:w-8" />
|
Wallet
|
||||||
Wallet
|
</h1>
|
||||||
</h1>
|
|
||||||
<Button variant="ghost" size="sm" @click="refresh" :disabled="isLoading">
|
|
||||||
<RefreshCw class="h-4 w-4" :class="{ 'animate-spin': isLoading }" />
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
<p class="text-sm sm:text-base text-muted-foreground mt-1">Manage your Bitcoin transactions</p>
|
<p class="text-sm sm:text-base text-muted-foreground mt-1">Manage your Bitcoin transactions</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue