File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
chrome/elements/pgp_block_modules Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import { XssSafeFactory } from '../../../js/common/xss-safe-factory.js';
14
14
import { Str } from '../../../js/common/core/common.js' ;
15
15
import { AttachmentWarnings } from '../shared/attachment_warnings.js' ;
16
16
import { MsgUtil } from '../../../js/common/core/crypto/pgp/msg-util.js' ;
17
- import { fileSize } from 'filesize' ;
17
+ import { filesize } from 'filesize' ;
18
18
19
19
export class PgpBlockViewAttachmentsModule {
20
20
public includedAttachments : Attachment [ ] = [ ] ;
@@ -27,8 +27,9 @@ export class PgpBlockViewAttachmentsModule {
27
27
for ( const i of attachments . keys ( ) ) {
28
28
const name = attachments [ i ] . name ? Str . stripPgpOrGpgExtensionIfPresent ( attachments [ i ] . name ) : 'noname' ;
29
29
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
+
32
33
const htmlContent = `<b>${ Xss . escape ( nameVisible ) } </b> ${ size } <span class="progress"><span class="percent"></span></span>` ;
33
34
const attachment = $ ( `<a href="#" index="${ Number ( i ) } ">` ) ;
34
35
attachment . attr ( 'title' , name ) ;
Original file line number Diff line number Diff line change 1
1
declare module 'filesize' {
2
- export function fileSize (
2
+ export function filesize (
3
3
bytes : number ,
4
4
) : string ;
5
5
}
You can’t perform that action at this time.
0 commit comments