Skip to content

Commit

Permalink
Hotfix for paper tgui crash (#1490)
Browse files Browse the repository at this point in the history
Co-authored-by: loanselot <[email protected]>
  • Loading branch information
Iajret and exdal authored Jan 7, 2024
1 parent ffa80c2 commit 39b20ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tgui/packages/tgui/interfaces/Biogenerator.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { BooleanLike } from 'common/react';
import { classes } from 'common/react';
import { useState } from 'react';

import { useBackend, useLocalState } from '../backend';
import {
Expand Down Expand Up @@ -185,7 +184,8 @@ export const Biogenerator = (props) => {
const ItemList = (props) => {
const { act } = useBackend();
const items = props.items.map((item) => {
const [amount, setAmount] = useState(
const [amount, setAmount] = useLocalState(
'amount' + item.name,
item.is_reagent ? Math.min(Math.max(props.space, 1), 10) : 1,
);
const disabled =
Expand Down
4 changes: 2 additions & 2 deletions tgui/packages/tgui/interfaces/PaperSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { clamp } from 'common/math';
import { classes } from 'common/react';
import { marked } from 'marked';
import { Component, createRef, RefObject, useState } from 'react';
import { Component, createRef, RefObject } from 'react';

import { useBackend, useLocalState } from '../backend';
import { Box, Button, Flex, Section, TextArea } from '../components';
Expand Down Expand Up @@ -315,7 +315,7 @@ export class PrimaryView extends Component {
{},
);

const [textAreaText, setTextAreaText] = useState('');
const [textAreaText, setTextAreaText] = useLocalState('textAreaText', '');

const interactMode =
held_item_details?.interaction_mode || InteractionType.reading;
Expand Down

0 comments on commit 39b20ab

Please sign in to comment.