mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-03-21 17:50:29 -05:00
Preact: properly extract targetRoomId from roomId in UserOptionsPanel (#2568)
This commit is contained in:
parent
a5de51e93d
commit
71341b1fba
|
|
@ -1,5 +1,5 @@
|
|||
import preact from "../js/lib/preact";
|
||||
import { toID, toRoomid, toUserid, Dex } from "./battle-dex";
|
||||
import { toID, toRoomid, toUserid, Dex, PSUtils } from "./battle-dex";
|
||||
import type { ID } from "./battle-dex-data";
|
||||
import { BattleLog } from "./battle-log";
|
||||
import { PSLoginServer } from "./client-connection";
|
||||
|
|
@ -230,7 +230,7 @@ class UserOptionsPanel extends PSRoomPanel {
|
|||
data?: Record<string, string>,
|
||||
};
|
||||
getTargets() {
|
||||
const [, targetUser, targetRoomid] = this.props.room.id.split('-');
|
||||
const [, targetUser, targetRoomid] = PSUtils.splitFirst(this.props.room.id, '-', 2);
|
||||
let targetRoom = (PS.rooms[targetRoomid] || null) as ChatRoom | null;
|
||||
if (targetRoom?.type !== 'chat') targetRoom = targetRoom?.getParent() as ChatRoom;
|
||||
if (targetRoom?.type !== 'chat') targetRoom = targetRoom?.getParent() as ChatRoom;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user