File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 7575 existingImage . style . opacity = '1' ; // Ensure initial opacity is 1
7676
7777 // Extract Entity ID from the card.
78- const entityId = cardElement . dataset . entityId || cardElement . querySelector ( `a[href^="${ currentConfig . urlPattern } "]` ) ?. href . match ( new RegExp ( `${ currentConfig . urlPattern . replace ( '/' , '\\/' ) } ([^\\/]+)` ) ) ?. [ 1 ] ;
78+ let entityId = cardElement . dataset . entityId || cardElement . querySelector ( `a[href^="${ currentConfig . urlPattern } "]` ) ?. href . match ( new RegExp ( `${ currentConfig . urlPattern . replace ( '/' , '\\/' ) } ([^\\/]+)` ) ) ?. [ 1 ] ;
79+
80+ // Ensure only the numerical ID is captured, removing any URL parameters
81+ if ( entityId ) {
82+ const paramIndex = entityId . indexOf ( '?' ) ;
83+ if ( paramIndex !== - 1 ) {
84+ entityId = entityId . substring ( 0 , paramIndex ) ;
85+ // console.log(`Stripped parameters from entityId: ${entityId}`);
86+ }
87+ }
7988
8089 if ( ! entityId ) {
8190 // console.warn(`${entityType} ID not found for card:`, cardElement);
You can’t perform that action at this time.
0 commit comments