Preact: Fix options menu in !commands

This commit is contained in:
Guangcong Luo 2026-03-15 06:18:49 +00:00
parent 3b0707924d
commit 12f3840ede
2 changed files with 6 additions and 1 deletions

View File

@ -484,7 +484,7 @@ class NewsPanel extends PSRoomPanel {
change = (ev: Event) => { change = (ev: Event) => {
const target = ev.currentTarget as HTMLInputElement; const target = ev.currentTarget as HTMLInputElement;
if (target.value === '1') { if (target.value === '1') {
document.cookie = "preactalpha=1; expires=Thu, 1 Jan 2026 12:00:00 UTC; path=/"; document.cookie = "preactalpha=1; expires=Thu, 1 May 2026 12:00:00 UTC; path=/";
} else { } else {
document.cookie = "preactalpha=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; document.cookie = "preactalpha=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
} }

View File

@ -702,6 +702,11 @@ export class PSView extends preact.Component {
parentElem: elem, parentElem: elem,
}); });
return true; return true;
case 'openOptions':
PS.join('options' as RoomID, {
parentElem: elem,
});
return true;
case 'showOtherFormats': { case 'showOtherFormats': {
// TODO: refactor to a command after we drop support for the old client // TODO: refactor to a command after we drop support for the old client
const table = elem.closest('table'); const table = elem.closest('table');