From a2d6506ae5d744a4af4c66ede5664e829290660d Mon Sep 17 00:00:00 2001 From: Jeroen Claassens Date: Sat, 10 Feb 2024 10:33:55 +0100 Subject: [PATCH] refactor(system-message): read class property for checkType --- .../discord-system-message/DiscordSystemMessage.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/src/components/discord-system-message/DiscordSystemMessage.ts b/packages/core/src/components/discord-system-message/DiscordSystemMessage.ts index e431b24d1..2dd4b2498 100644 --- a/packages/core/src/components/discord-system-message/DiscordSystemMessage.ts +++ b/packages/core/src/components/discord-system-message/DiscordSystemMessage.ts @@ -165,10 +165,10 @@ export class DiscordSystemMessage extends LitElement implements LightTheme { @property({ type: Boolean, reflect: true, attribute: 'light-theme' }) public accessor lightTheme = false; - public checkType(value: string) { - if (typeof value !== 'string') { + public checkType() { + if (typeof this.type !== 'string') { throw new TypeError('DiscordSystemMessage `type` prop must be a string.'); - } else if (!['join', 'leave', 'call', 'missed-call', 'boost', 'edit', 'thread', 'pin', 'alert', 'error'].includes(value)) { + } else if (!['join', 'leave', 'call', 'missed-call', 'boost', 'edit', 'thread', 'pin', 'alert', 'error'].includes(this.type)) { throw new RangeError( "DiscordSystemMessage `type` prop must be one of: 'join', 'leave', 'call', 'missed-call', 'boost', 'edit', 'thread', 'pin', 'alert', 'error'" ); @@ -183,7 +183,7 @@ export class DiscordSystemMessage extends LitElement implements LightTheme { protected override render() { this.timestamp = handleTimestamp(this.timestamp); - this.checkType(this.type); + this.checkType(); let icon: TemplateResult<1>;