From fb60c69846965bd6f3a6b8eeb3cc7fab0bf2c58f Mon Sep 17 00:00:00 2001 From: xds Date: Tue, 10 Mar 2026 15:54:34 +0300 Subject: [PATCH] fix tx isdone checkbox text size --- src/services/transactions-service.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/services/transactions-service.ts b/src/services/transactions-service.ts index e3e764e..6f7fa26 100644 --- a/src/services/transactions-service.ts +++ b/src/services/transactions-service.ts @@ -85,13 +85,25 @@ async function exportTransactions(spaceId: number, filters: TransactionFilters): let response = await api.post(`/spaces/${spaceId}/transactions/_export`, filters, { responseType: 'blob' }); - const url = window.URL.createObjectURL(new Blob([response.data])); + + const contentDisposition = response.headers['content-disposition']; + let fileName = `transactions_${spaceId}_${toDateOnly(new Date())}.csv`; + + if (contentDisposition) { + const fileNameMatch = contentDisposition.match(/filename\*?=['"]?(?:UTF-8'')?([^; '"]+)['"]?/i); + if (fileNameMatch && fileNameMatch[1]) { + fileName = decodeURIComponent(fileNameMatch[1]); + } + } + + const url = window.URL.createObjectURL(response.data); const link = document.createElement('a'); link.href = url; - link.setAttribute('download', `transactions_${spaceId}_${toDateOnly(new Date())}.csv`); + link.setAttribute('download', fileName); document.body.appendChild(link); link.click(); link.remove(); + window.URL.revokeObjectURL(url); } catch (error) { console.error(error); throw error;