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

Inbox - Move the Inbox refs from Profile to Account #1297

Open
gdorsi opened this issue Jan 29, 2025 — with Linear · 0 comments
Open

Inbox - Move the Inbox refs from Profile to Account #1297

gdorsi opened this issue Jan 29, 2025 — with Linear · 0 comments

Comments

Copy link
Contributor

gdorsi commented Jan 29, 2025

We should move the data from Profile directly to Account.

The problem with profile is that devs should be able to do anything with it without breaking Jazz and having the Inbox there makes things harder to manage.

Should be something like this:

class Inbox extends CoMap {
  inbox = co.optional.json<CoID<InboxRoot>>();
  inboxInvite = co.optional.json<InboxInvite>();
}
export class Account extends CoValueBase implements CoValue {
  static {
    this._schema = {
      profile: {
        ref: () => Profile,
        optional: false,
      } satisfies RefEncoded<Profile>,
      root: {
        ref: () => RegisteredSchemas["CoMap"],
        optional: true,
      } satisfies RefEncoded<CoMap>,
      inbox: {
        ref: () => Inbox,
        optional: false,
      } satisfies RefEncoded<Inbox>,
    };
  }
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

No branches or pull requests

1 participant