mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-26 04:07:56 -05:00
Preact: Fix offline friend requests
In oldclient, <button type="send"> would send a message globally. Preact client has now been updated with this behavior. We probably still want the server to be able to handle commands sent to offline users at some later point, though.
This commit is contained in:
@@ -485,7 +485,7 @@ class NewsPanel extends PSRoomPanel {
|
||||
change = (ev: Event) => {
|
||||
const target = ev.currentTarget as HTMLInputElement;
|
||||
if (target.value === '1') {
|
||||
document.cookie = "preactalpha=1; expires=Thu, 1 Jun 2026 12:00:00 UTC; path=/";
|
||||
document.cookie = "preactalpha=1; expires=Thu, 1 Jul 2026 12:00:00 UTC; path=/";
|
||||
} else {
|
||||
document.cookie = "preactalpha=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
|
||||
}
|
||||
|
||||
@@ -745,13 +745,11 @@ export class PSView extends preact.Component {
|
||||
elem.innerText = 'Copied!';
|
||||
return true;
|
||||
case 'send':
|
||||
PS.send(elem.value);
|
||||
return true;
|
||||
case 'cmd':
|
||||
const room = PS.getRoom(elem) || PS.mainmenu;
|
||||
if (elem.name === 'send') {
|
||||
room.sendDirect(elem.value);
|
||||
} else {
|
||||
room.send(elem.value);
|
||||
}
|
||||
room.send(elem.value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user