Preact: Trim command targets (#2439)

This commit is contained in:
bingingem 2025-05-23 12:31:27 -05:00 committed by GitHub
parent 917855a0ec
commit 2747808d6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1626,7 +1626,7 @@ export class PSRoom extends PSStreamModel<Args | null> implements RoomOptions {
if (!line.startsWith('/') || line.startsWith('//')) return line;
const spaceIndex = line.indexOf(' ');
const cmd = (spaceIndex >= 0 ? line.slice(1, spaceIndex) : line.slice(1)) as 'parsed';
const target = spaceIndex >= 0 ? line.slice(spaceIndex + 1) : '';
const target = spaceIndex >= 0 ? line.slice(spaceIndex + 1).trim() : '';
const cmdHandler = this.globalClientCommands[cmd] || this.clientCommands?.[cmd];
if (!cmdHandler) return line;