mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 10:42:51 +02:00
Merge branch 'dev' of github.com:danielyxie/bitburner into feature/grafting
This commit is contained in:
@@ -3,7 +3,7 @@ import { EventEmitter } from "../../utils/EventEmitter";
|
||||
import { Modal } from "./Modal";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Box from "@mui/material/Box";
|
||||
import {sha256} from "js-sha256";
|
||||
import { sha256 } from "js-sha256";
|
||||
|
||||
export const AlertEvents = new EventEmitter<[string | JSX.Element]>();
|
||||
|
||||
@@ -23,8 +23,8 @@ export function AlertManager(): React.ReactElement {
|
||||
i++;
|
||||
setAlerts((old) => {
|
||||
const hash = getMessageHash(text);
|
||||
if (old.some(a => a.hash === hash)) {
|
||||
console.log('Duplicate message');
|
||||
if (old.some((a) => a.hash === hash)) {
|
||||
console.log("Duplicate message");
|
||||
return old;
|
||||
}
|
||||
return [
|
||||
@@ -51,7 +51,7 @@ export function AlertManager(): React.ReactElement {
|
||||
}, []);
|
||||
|
||||
function getMessageHash(text: string | JSX.Element): string {
|
||||
if (typeof text === 'string') return sha256(text);
|
||||
if (typeof text === "string") return sha256(text);
|
||||
return sha256(JSON.stringify(text.props));
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ export function CodingContractModal(): React.ReactElement {
|
||||
// whatever ...
|
||||
const value = (event.target as any).value;
|
||||
|
||||
if (event.keyCode === KEY.ENTER && value !== "") {
|
||||
if (event.key === KEY.ENTER && value !== "") {
|
||||
event.preventDefault();
|
||||
props.onAttempt(answer);
|
||||
setAnswer("");
|
||||
|
||||
@@ -6,6 +6,7 @@ import Button from "@mui/material/Button";
|
||||
import Select, { SelectChangeEvent } from "@mui/material/Select";
|
||||
import TextField from "@mui/material/TextField";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import { KEY } from "../../utils/helpers/keyCodes";
|
||||
|
||||
export const PromptEvent = new EventEmitter<[Prompt]>();
|
||||
|
||||
@@ -93,7 +94,7 @@ function PromptMenuText({ resolve }: IContentProps): React.ReactElement {
|
||||
const onKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {
|
||||
event.stopPropagation();
|
||||
|
||||
if (event.key === "Enter") {
|
||||
if (event.key === KEY.ENTER) {
|
||||
event.preventDefault();
|
||||
submit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user