@@ -46,7 +46,7 @@ export interface ThumbnailBtnProp {
4646export class ThumbnailButton extends HTMLElement {
4747 private btn ?: HTMLButtonElement ;
4848 private status : ThumbnailBtnStatus = ThumbnailBtnStatus . Init ;
49- private mediaId : number ;
49+ private mediaId : string ;
5050 private page ?: number ;
5151 private type ?: ThumbnailBtnType ;
5252 private onClick : ThumbnailBtnProp [ 'onClick' ] ;
@@ -56,7 +56,7 @@ export class ThumbnailButton extends HTMLElement {
5656 private progress = 0 ;
5757 private dirty = false ;
5858
59- #downloadingId: number | null = null ;
59+ #downloadingId: string | null = null ;
6060 #downloadingPage: number | undefined | null = null ;
6161
6262 constructor ( props : ThumbnailBtnProp ) {
@@ -65,8 +65,8 @@ export class ThumbnailButton extends HTMLElement {
6565 this . onClick = props . onClick ;
6666
6767 // modifying `dataset` triggers `attributeChangedCallback`, so we should assign private value before dataset.
68- this . mediaId = this . toValidatedNumber ( props . id ) ;
69- this . dataset . id = String ( this . mediaId ) ;
68+ this . mediaId = String ( props . id ) ;
69+ this . dataset . id = this . mediaId ;
7070
7171 if ( props . type ) {
7272 this . dataset . type = this . type = props . type ;
@@ -158,15 +158,15 @@ export class ThumbnailButton extends HTMLElement {
158158 try {
159159 if ( id === null ) throw new Error ( 'Attribute "data-id" is required.' ) ;
160160
161- this . mediaId = this . toValidatedNumber ( id ) ;
161+ this . mediaId = id ;
162162
163163 this . #resetStatus( ) ;
164164 this . #downloadingId && ( this . #downloadingId = null ) ;
165165
166166 this . connectedFlag && this . shouldObserveDb && this . observeDb ( ) ( ) ;
167167 } catch ( error ) {
168168 logger . error ( error ) ;
169- this . dataset . id = String ( this . mediaId ) ;
169+ this . dataset . id = this . mediaId ;
170170 }
171171 }
172172
0 commit comments