Skip to content

Commit af095f1

Browse files
committed
fix: test
1 parent eba7c84 commit af095f1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

extension/chrome/elements/pgp_block_modules/pgp-block-attachments-module.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { XssSafeFactory } from '../../../js/common/xss-safe-factory.js';
1414
import { Str } from '../../../js/common/core/common.js';
1515
import { AttachmentWarnings } from '../shared/attachment_warnings.js';
1616
import { MsgUtil } from '../../../js/common/core/crypto/pgp/msg-util.js';
17-
import { fileSize } from 'filesize';
17+
import { filesize } from 'filesize';
1818

1919
export class PgpBlockViewAttachmentsModule {
2020
public includedAttachments: Attachment[] = [];
@@ -27,8 +27,9 @@ export class PgpBlockViewAttachmentsModule {
2727
for (const i of attachments.keys()) {
2828
const name = attachments[i].name ? Str.stripPgpOrGpgExtensionIfPresent(attachments[i].name) : 'noname';
2929
const nameVisible = name.length > 100 ? name.slice(0, 100) + '…' : name;
30-
const size = fileSize(attachments[i].length);
31-
// eslint-disable-next-line @typescript-eslint/no-base-to-string
30+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
31+
const size = filesize(attachments[i].length);
32+
3233
const htmlContent = `<b>${Xss.escape(nameVisible)}</b>&nbsp;&nbsp;&nbsp;${size}<span class="progress"><span class="percent"></span></span>`;
3334
const attachment = $(`<a href="#" index="${Number(i)}">`);
3435
attachment.attr('title', name);

extension/types/file-size.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
declare module 'filesize' {
2-
export function fileSize(
2+
export function filesize(
33
bytes: number,
44
): string;
55
}

0 commit comments

Comments
 (0)