From 1dfa34ed79627a8025e5cee9246b741923cfaaff Mon Sep 17 00:00:00 2001 From: dab246 Date: Mon, 1 Apr 2024 14:47:04 +0700 Subject: [PATCH] TF-2754 Remove bytes param unnecessary --- core/lib/utils/html/html_utils.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/lib/utils/html/html_utils.dart b/core/lib/utils/html/html_utils.dart index 60b1e82c2..43c860a0e 100644 --- a/core/lib/utils/html/html_utils.dart +++ b/core/lib/utils/html/html_utils.dart @@ -241,7 +241,7 @@ class HtmlUtils { console.error(reason); }); - ${_fileInfoScript(bytes, fileName)} + ${_fileInfoScript(fileName)} ${_downloadButtonListenerScript(bytes, fileName)} @@ -308,7 +308,7 @@ class HtmlUtils { const bytesJs = new Uint8Array(${bytes.toJS}); PDFObject.embed('data:application/pdf;base64,$base64', "#pdf-viewer"); - ${_fileInfoScript(bytes, fileName)} + ${_fileInfoScript(fileName)} ${_downloadButtonListenerScript(bytes, fileName)} @@ -406,7 +406,7 @@ class HtmlUtils { });'''; } - static String _fileInfoScript(Uint8List bytes, String? fileName) { + static String _fileInfoScript(String? fileName) { return ''' function formatFileSize(bytes) { if (bytes === 0) return '0 Bytes'; @@ -420,7 +420,6 @@ class HtmlUtils { fileNameSpan.textContent = "$fileName"; const fileSizeSpan = document.getElementById('file-size'); - const byteArray = new Uint8Array(${bytes.toJS}); fileSizeSpan.textContent = formatFileSize(bytesJs.length);'''; } }