Skip to content

Commit

Permalink
[FE] BUG: currentFloorNumberState atom의 초기값 0으로 교체해 type error 해결 #1727
Browse files Browse the repository at this point in the history
  • Loading branch information
jnkeniaem committed Jan 22, 2025
1 parent 6d3b936 commit 0e7f6b7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config
16 changes: 9 additions & 7 deletions frontend/src/Cabinet/pages/admin/AdminMainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ const AdminMainPage = () => {
currentSectionNameState
);
const currentBuilding = useRecoilValue<string>(currentBuildingNameState);
const currentFloor = useRecoilValue<number>(currentFloorNumberState);
// const currentFloor = useRecoilValue<number>(currentFloorNumberState);
const { refreshCabinetList, isLoading } = useCabinetListRefresh(
currentBuilding,
currentFloor
currentFloorNumber
);

const currentSectionIndex = sectionList.findIndex(
Expand Down Expand Up @@ -93,6 +93,8 @@ const AdminMainPage = () => {
else moveToRightSection();
};

// console.log("admin currentFloor : ", currentFloor);

return isLoading ? (
<LoadingAnimation />
) : (
Expand All @@ -103,10 +105,7 @@ const AdminMainPage = () => {
touchStartPosY.current = e.changedTouches[0].screenY;
}}
onTouchEnd={(e: React.TouchEvent) => {
swipeSection(
e.changedTouches[0].screenX,
e.changedTouches[0].screenY
);
swipeSection(e.changedTouches[0].screenX, e.changedTouches[0].screenY);
}}
>
<SectionPaginationContainer />
Expand All @@ -118,7 +117,10 @@ const AdminMainPage = () => {
/>
</MultiSelectButtonWrapperStyled>
<CabinetListWrapperStyled>
<CabinetListContainer isAdmin={true} currentFloor={currentFloorNumber} />
<CabinetListContainer
isAdmin={true}
currentFloor={currentFloorNumber}
/>

<RefreshButtonStyled
className="cabiButton"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Cabinet/recoil/atoms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const currentBuildingNameState = atom<string>({

export const currentFloorNumberState = atom<number>({
key: "CurrentFloor",
default: undefined,
default: 0,
effects_UNSTABLE: [persistAtom],
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const LeftMainNavContainer = ({ isAdmin }: { isAdmin?: boolean }) => {
resetCurrentSection();
navigator("/login");
};

return (
<LeftMainNav
pathname={pathname}
Expand Down

0 comments on commit 0e7f6b7

Please sign in to comment.