fix: Channel creation matching bug
Bug where the channel creation dialog wouldn't throw an error if you typed the name of an existing channel that had hyphens, or a channel with the same name but spaces instead of hyphens. This is because channelnames are stores with underscores internally, and channelnames were not sanitized in the `checkChannel()` method on the `Db` class
This commit is contained in:
parent
ee1eac23ab
commit
6ae992d586
@ -73,6 +73,7 @@ class Db {
|
|||||||
|
|
||||||
async checkChannel(channel: string): Promise<boolean> {
|
async checkChannel(channel: string): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
|
channel = sanitizeChannelName(channel);
|
||||||
const res = await this.client.execute(`SELECT table_name FROM system_schema.tables WHERE keyspace_name = 'channels' AND table_name = ?`, [
|
const res = await this.client.execute(`SELECT table_name FROM system_schema.tables WHERE keyspace_name = 'channels' AND table_name = ?`, [
|
||||||
channel.toLowerCase(),
|
channel.toLowerCase(),
|
||||||
]);
|
]);
|
||||||
|
Loading…
Reference in New Issue
Block a user