Skip to content

Commit

Permalink
Merge pull request #44 from czfadmin:fix/sort
Browse files Browse the repository at this point in the history
fix(sort): 修复分组中只有两个排序时,无法正常排序问题
  • Loading branch information
czfadmin committed Jul 9, 2024
2 parents e1c958f + dc50c9b commit a7d0259
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/stores/bookmark-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,9 +647,6 @@ export const BookmarksStore = types
default:
return;
}
// if (!bookmarks) {
// return;
// }
}

function addGroupInfo(
Expand Down
2 changes: 1 addition & 1 deletion src/stores/bookmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export const Bookmark = types
});

/**
* 增加hooks, 将bookmark数据转换
* 增加hooks, 将bookmark数据转换, PS: 暂时未使用到此hooks
*/
export const BookmarkProcessorModel: ISnapshotProcessor<
typeof Bookmark,
Expand Down
7 changes: 5 additions & 2 deletions src/views/BaseTreeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,12 @@ export default class BaseTreeView<T extends BaseTreeItem, C extends IController>
sourceContextValue === BookmarkTreeItemCtxValueEnum.BOOKMARK
) {
if (sourceMeta.groupId === targetMeta.groupId) {
const targetIdx =
targetMeta.sortedInfo[self._controller.groupView];
self._controller.updateBookmarkSortedInfo(sourceMeta, targetIdx);
self._controller.updateBookmarkSortedInfo(
sourceMeta,
targetMeta.sortedInfo[self._controller.groupView],
targetMeta,
targetIdx + 1,
);
}
}
Expand Down

0 comments on commit a7d0259

Please sign in to comment.