Skip to content

Commit

Permalink
fix: properly fix the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Dec 1, 2024
1 parent cddf3b1 commit be509e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class DiscordEmbedField extends LitElement implements LightTheme {
* @defaultValue 1
*/
@property({ type: Number, reflect: true, attribute: 'inline-index' })
public accessor inlineIndex = 1;
public accessor inlineIndex: number | undefined = undefined;

@consume({ context: messagesLightTheme, subscribe: true })
@property({ type: Boolean, reflect: true, attribute: 'light-theme' })
Expand All @@ -83,7 +83,7 @@ export class DiscordEmbedField extends LitElement implements LightTheme {
private readonly validInlineIndices = new Set([1, 2, 3]);

public checkInlineIndex() {
if (this.inline && this.inlineIndex) {
if (this.inlineIndex) {
const inlineIndexAsNumber = Number(this.inlineIndex);
if (!Number.isNaN(inlineIndexAsNumber) && !this.validInlineIndices.has(inlineIndexAsNumber)) {
throw new RangeError('DiscordEmbedField `inlineIndex` prop must be one of: 1, 2, or 3');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ export class DiscordEmbedFields extends LitElement {
::slotted([inline-index='3']) {
grid-column: 9/13 !important;
}
::slotted(:not([inline])) {
grid-column: 1/13 !important;
}
`;

protected override render() {
Expand Down

0 comments on commit be509e0

Please sign in to comment.