mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 23:09:27 +02:00
Undid some changes and cleaned up some code
This commit is contained in:
parent
fd9248dd91
commit
7c7ebb2ab8
@ -1,6 +1,6 @@
|
|||||||
VITE_BYPASS_LOGIN=0
|
VITE_BYPASS_LOGIN=1
|
||||||
VITE_BYPASS_TUTORIAL=0
|
VITE_BYPASS_TUTORIAL=0
|
||||||
VITE_SERVER_URL=http://192.168.1.101:8001
|
VITE_SERVER_URL=http://localhost:8001
|
||||||
VITE_DISCORD_CLIENT_ID=1234567890
|
VITE_DISCORD_CLIENT_ID=1234567890
|
||||||
VITE_GOOGLE_CLIENT_ID=1234567890
|
VITE_GOOGLE_CLIENT_ID=1234567890
|
||||||
VITE_I18N_DEBUG=1
|
VITE_I18N_DEBUG=1
|
||||||
|
@ -390,11 +390,9 @@ export default class MenuUiHandler extends MessageUiHandler {
|
|||||||
handler: () => {
|
handler: () => {
|
||||||
|
|
||||||
const options: OptionSelectItem[] = [];
|
const options: OptionSelectItem[] = [];
|
||||||
//for (let i = 0; i < Object.values(AdminMode).filter((v) => !isNaN(Number(v))).length; i++) {
|
|
||||||
//fields.forEach((field, f) => {
|
|
||||||
Object.values(AdminMode).filter((v) => !isNaN(Number(v))).forEach((mode) => {
|
Object.values(AdminMode).filter((v) => !isNaN(Number(v))).forEach((mode) => {
|
||||||
options.push({
|
options.push({
|
||||||
label: getAdminModeName(mode),
|
label: getAdminModeName(mode as AdminMode),
|
||||||
handler: () => {
|
handler: () => {
|
||||||
ui.playSelect();
|
ui.playSelect();
|
||||||
ui.setOverlayMode(Mode.ADMIN, {
|
ui.setOverlayMode(Mode.ADMIN, {
|
||||||
@ -424,40 +422,10 @@ export default class MenuUiHandler extends MessageUiHandler {
|
|||||||
options: options,
|
options: options,
|
||||||
delay: 0
|
delay: 0
|
||||||
});
|
});
|
||||||
|
|
||||||
//ui.playSelect();
|
|
||||||
//ui.setOverlayMode(Mode.ADMIN, {
|
|
||||||
// buttonActions: [
|
|
||||||
// () => {
|
|
||||||
// ui.revertMode();
|
|
||||||
// },
|
|
||||||
// () => {
|
|
||||||
// ui.revertMode();
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
//}, AdminMode.LINK);
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
keepOpen: true
|
keepOpen: true
|
||||||
});
|
});
|
||||||
//communityOptions.push({
|
|
||||||
// label: "Admin2",
|
|
||||||
// handler: () => {
|
|
||||||
// ui.playSelect();
|
|
||||||
// ui.setOverlayMode(Mode.ADMIN, {
|
|
||||||
// buttonActions: [
|
|
||||||
// () => {
|
|
||||||
// ui.revertMode();
|
|
||||||
// },
|
|
||||||
// () => {
|
|
||||||
// ui.revertMode();
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
// }, AdminMode.UNLINK);
|
|
||||||
// return true;
|
|
||||||
// },
|
|
||||||
// keepOpen: true
|
|
||||||
//});
|
|
||||||
}
|
}
|
||||||
communityOptions.push({
|
communityOptions.push({
|
||||||
label: i18next.t("menuUiHandler:cancel"),
|
label: i18next.t("menuUiHandler:cancel"),
|
||||||
|
@ -284,16 +284,16 @@ export const isBeta = import.meta.env.MODE === "beta"; // this checks to see if
|
|||||||
export function setCookie(cName: string, cValue: string): void {
|
export function setCookie(cName: string, cValue: string): void {
|
||||||
const expiration = new Date();
|
const expiration = new Date();
|
||||||
expiration.setTime(new Date().getTime() + 3600000 * 24 * 30 * 3/*7*/);
|
expiration.setTime(new Date().getTime() + 3600000 * 24 * 30 * 3/*7*/);
|
||||||
document.cookie = `${cName}=${cValue};SameSite=Strict;Domain=${window.location.hostname};Path=/;Expires=${expiration.toUTCString()}`;
|
document.cookie = `${cName}=${cValue};Secure;SameSite=Strict;Domain=${window.location.hostname};Path=/;Expires=${expiration.toUTCString()}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function removeCookie(cName: string): void {
|
export function removeCookie(cName: string): void {
|
||||||
if (isBeta) {
|
if (isBeta) {
|
||||||
document.cookie = `${cName}=;SameSite=Strict;Domain=pokerogue.net;Path=/;Max-Age=-1`; // we need to remove the cookie from the main domain as well
|
document.cookie = `${cName}=;Secure;SameSite=Strict;Domain=pokerogue.net;Path=/;Max-Age=-1`; // we need to remove the cookie from the main domain as well
|
||||||
}
|
}
|
||||||
|
|
||||||
document.cookie = `${cName}=;SameSite=Strict;Domain=${window.location.hostname};Path=/;Max-Age=-1`;
|
document.cookie = `${cName}=;Secure;SameSite=Strict;Domain=${window.location.hostname};Path=/;Max-Age=-1`;
|
||||||
document.cookie = `${cName}=;SameSite=Strict;Path=/;Max-Age=-1`; // legacy cookie without domain, for older cookies to prevent a login loop
|
document.cookie = `${cName}=;Secure;SameSite=Strict;Path=/;Max-Age=-1`; // legacy cookie without domain, for older cookies to prevent a login loop
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getCookie(cName: string): string {
|
export function getCookie(cName: string): string {
|
||||||
|
Loading…
Reference in New Issue
Block a user