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

feat: Imp[NoteSettings] add func to sort team in correct order #308

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

3388ShubinPavel
Copy link

  • Add sortMembers function that sorts members in order Creator -> Writer -> Reader
  • Change view to display team from sortedMember array

@3388ShubinPavel 3388ShubinPavel linked an issue Feb 26, 2025 that may be closed by this pull request
Comment on lines +69 to +70
const isCreatorA = String(a.user.id) === props.noteId;
const isCreatorB = String(b.user.id) === props.noteId;
Copy link
Collaborator

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

Comment on lines +79 to +81
if (!roleOrder[a.role] && !roleOrder[b.role]) {
return 0;
}
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Imp[NoteSettings]: Display team in in correct order
3 participants