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

Expose RoleId constants to front end #532

Open
ErikSin opened this issue Mar 28, 2024 · 0 comments · May be fixed by #704
Open

Expose RoleId constants to front end #532

ErikSin opened this issue Mar 28, 2024 · 0 comments · May be fixed by #704
Assignees

Comments

@ErikSin
Copy link

ErikSin commented Mar 28, 2024

The roles are constants used as unique identifiers.

The front end needs access to these constants in order to match the roleIds with each role.

Currently the front end is copying and pasting these constants into the front end from the @mapeo/core

EvanHahn added a commit that referenced this issue Jun 19, 2024
You can now import `CREATOR_ROLE_ID`, `COORDINATOR_ROLE_ID`, and
`MEMBER_ROLE_ID`.

```javascript
import { roles } from '@mapeo/core'

myProject.$member.invite(deviceId, { roleId: roles.MEMBER_ROLE_ID })
```

CoMapeo Mobile [currently hard-codes these values][0].

Note that "weirder" IDs, like `LEFT_ROLE_ID`, are deliberately *not
exported right now* because they're easy to add later if needed.

Closes [#532].

[#532]: #532
[0]: https://github.com/digidem/comapeo-mobile/blob/2cfa789360a2faa066a85fde8aad73d5e80a5dfd/src/frontend/sharedTypes/index.ts#L31-L37
@EvanHahn EvanHahn self-assigned this Jun 19, 2024
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 a pull request may close this issue.

2 participants