Skip to content

Commit

Permalink
こっちの修正方法の方が筋がいいわ
Browse files Browse the repository at this point in the history
  • Loading branch information
toririm committed Oct 4, 2024
1 parent 71f9e93 commit baf93f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/components/functional/useOrderState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type ApplyDiscount = Action<
>;
type RemoveDiscount = Action<"removeDiscount">;
type SetReceived = Action<"setReceived", { received: string }>;
type SetDescription = Action<"setDescription", { description: string | null }>;
type SetDescription = Action<"setDescription", { description: string }>;
/**
* オーダーの状態を更新するためのアクション型
*/
Expand Down Expand Up @@ -95,7 +95,7 @@ const setReceived: OrderReducer<SetReceived> = (state, action) => {

const setDescription: OrderReducer<SetDescription> = (state, action) => {
const updated = state.clone();
updated.description = action.description;
updated.description = action.description || null;
return updated;
};

Expand Down
5 changes: 1 addition & 4 deletions app/components/pages/CashierV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,7 @@ const CashierV2 = ({ items, orders, submitPayload }: props) => {
key={`Description-${UISession.key}`}
onTextSet={useCallback(
(text) =>
newOrderDispatch({
type: "setDescription",
description: text || null,
}),
newOrderDispatch({ type: "setDescription", description: text }),
[newOrderDispatch],
)}
focus={inputStatus === "description"}
Expand Down

0 comments on commit baf93f0

Please sign in to comment.