Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(view): commit 중복 bug fix #508

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/view/src/components/Detail/Detail.hook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const useToggleHook = (init = false): UseToggleHook => {

export const useCommitListHide = (commitNodeListInCluster: CommitNode[]) => {
const list = getSummaryCommitList(commitNodeListInCluster).reverse();
const strech = commitNodeListInCluster.slice(5, commitNodeListInCluster.length).reverse();
const strech = commitNodeListInCluster.reverse();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다섯개 단위로 접혀서 나오는 건지요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아니요, 기존의 동작과 동일하게 작동합니다!
처음에 5개가 나온 후, readmore을 누르면 전체 commit 이 나오고 hide를 누르면 5개가 보여지는 처음의 상태로 돌아갑니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5개 단위로 접혀서 나오도록 수정해보겠습니다!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗. 넵!

const [toggle, handleToggle] = useToggleHook();
const commitNodeList = toggle ? [...list, ...strech] : list;
const commitNodeList = toggle ? strech : list;

return {
toggle,
Expand Down