File tree 2 files changed +18
-10
lines changed
packages/core/src/components
2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { consume } from '@lit/context';
2
2
import { css , html , LitElement } from 'lit' ;
3
3
import { customElement , property } from 'lit/decorators.js' ;
4
4
import { ifDefined } from 'lit/directives/if-defined.js' ;
5
+ import { when } from 'lit/directives/when.js' ;
5
6
import type { LightTheme } from '../../types.js' ;
6
7
import { messagesLightTheme } from '../discord-messages/DiscordMessages.js' ;
7
8
@@ -131,7 +132,11 @@ export class DiscordReaction extends LitElement implements LightTheme {
131
132
132
133
protected override render ( ) {
133
134
return html `< div class ="discord-reaction-inner " @click =${ this . handleReactionClick } @keydown =${ this . handleReactionClick } >
134
- < img src =${ ifDefined ( this . emoji ) } alt =${ ifDefined ( this . name ) } draggable="false" />
135
+ ${ when (
136
+ this . emoji . includes ( 'http' ) || this . emoji . startsWith ( '/' ) || this . emoji . startsWith ( './' ) ,
137
+ ( ) => html `< img src =${ ifDefined ( this . emoji ) } alt =${ ifDefined ( this . name ) } draggable="false" /> ` ,
138
+ ( ) => html `< span > ${ this . emoji } </ span > `
139
+ ) }
135
140
< span class ="discord-reaction-count "> ${ this . count } </ span >
136
141
</ div > ` ;
137
142
}
Original file line number Diff line number Diff line change @@ -98,15 +98,18 @@ export class DiscordStringSelectMenuOption extends LitElement implements LightTh
98
98
99
99
return html `
100
100
< label >
101
- ${ when (
102
- this . emoji ,
103
- ( ) =>
104
- html `< img
105
- src =${ this . emoji }
106
- alt =${ ifDefined ( this . emojiName ) }
107
- draggable="true"
108
- class="discord-string-select-menu-option-emoji"
109
- /> `
101
+ ${ when ( this . emoji , ( ) =>
102
+ when (
103
+ this . emoji . includes ( 'http' ) || this . emoji . startsWith ( '/' ) || this . emoji . startsWith ( './' ) ,
104
+ ( ) =>
105
+ html `< img
106
+ src =${ this . emoji }
107
+ alt =${ ifDefined ( this . emojiName ) }
108
+ draggable="true"
109
+ class="discord-string-select-menu-option-emoji"
110
+ /> ` ,
111
+ ( ) => html `< span class ="discord-string-select-menu-option-emoji "> ${ this . emoji } </ span > `
112
+ )
110
113
) }
111
114
< div class ="discord-string-select-menu-option-ellipsis-text ">
112
115
< div class ="discord-string-select-menu-option-ellipsis-text ">
You can’t perform that action at this time.
0 commit comments