-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: Imp[NoteSettings] add func to sort team in correct order #308
base: main
Are you sure you want to change the base?
Conversation
3388ShubinPavel
commented
Feb 26, 2025
- Add sortMembers function that sorts members in order Creator -> Writer -> Reader
- Change view to display team from sortedMember array
const isCreatorA = String(a.user.id) === props.noteId; | ||
const isCreatorB = String(b.user.id) === props.noteId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user.id
should never be equal to noteId
if (!roleOrder[a.role] && !roleOrder[b.role]) { | ||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this condition will work if both roles are write and you will get (!0 && !0)
condition
however below you have condition that will return same thing for same data (0 === 0)
so this condition seems redundant