Closed pepoospina closed 3 years ago
In the app home, replace the create document with a default document id derivation (the "document" is the home space)
async newDocument(title: string) {
this.creatingNewDocument = true;
const remote = this.requestAll(EveesModule.bindings.EveesRemote).find((provider: EveesRemote) =>
provider.id.startsWith('http')
) as EveesRemote;
const perspective = await remote.getHome(remote.userId);
const id = await remote.store.create(perspective.object);
if (id !== perspective.id) {
throw new Error('unexpected id');
}
this.go(perspective.id);
}
In the evees.http.ts, add the getHome method
async getHome(userId?: string) {
if (!userId) throw new Error('user id must be defined');
this.logger.warn('remote random int when done');
const remoteHome = {
remote: this.id,
path: '',
creatorId: userId,
timestamp: 0,
context: `home`
};
return deriveSecured(remoteHome, this.store.cidConfig);
}
Now the app should render the home perspective of the user always
Since you are working on an old version, patch the evees.remote.ts interface to add the getHome method
Missing changes
login
button.Router.go(...)
When a user enters home.ts of linked-thoughts and is logged in, it should get its home perspective, and if the perspective does not exist, he should create it. Once the perspective is created, it should be rendered using a new web-component called