Skip to content

Preact: properly extract targetRoomId from roomId in UserOptionsPanel#2568

Merged
Zarel merged 3 commits intosmogon:masterfrom
ISenseAura:bugfixesv30
Mar 15, 2026
Merged

Preact: properly extract targetRoomId from roomId in UserOptionsPanel#2568
Zarel merged 3 commits intosmogon:masterfrom
ISenseAura:bugfixesv30

Conversation

@ISenseAura
Copy link
Member

@ISenseAura ISenseAura commented Dec 9, 2025

this makes it work for DM rooms

Comment on lines +233 to +234
const [, targetUser, ...rest] = this.props.room.id.split('-');
const targetRoomid = rest.join('-');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, isn't there Utils.splitFirst for this?

Image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const [, targetUser, ...rest] = this.props.room.id.split('-');
const targetRoomid = rest.join('-');
const [, targetUser, targetRoomid] = PSUtils.splitFirst(this.props.room.id, '-', 2);

@Zarel Zarel merged commit 71341b1 into smogon:master Mar 15, 2026
1 check passed
@Zarel
Copy link
Member

Zarel commented Mar 15, 2026

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants