Skip to content

Typescript QuickStart fixes #59

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/sdks/typescript/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ First, we need to create a SpacetimeDB client and connect to the module. Create

We are going to create a stateful variable to store our client's SpacetimeDB identity when we receive it. Also, we are using `localStorage` to retrieve your auth token if this client has connected before. We will explain these later.

Replace `<module-name>` with the name you chose when publishing your module during the module quickstart. If you are using SpacetimeDB Cloud, the host will be `wss://spacetimedb.com/spacetimedb`.
Replace `<module-name>` with the name you chose when publishing your module during the module quickstart. If you are using SpacetimeDB Cloud, the host will be `wss://spacetimedb.com`.

Add this before the `App` function declaration:

Expand Down Expand Up @@ -271,9 +271,9 @@ function userNameOrIdentity(user: User): string {
if (user.name !== null) {
return user.name || "";
} else {
var identityStr = new Identity(user.identity).toHexString();
var identityStr = new Identity(user.identity.toUint8Array()).toHexString();
console.log(`Name: ${identityStr} `);
return new Identity(user.identity).toHexString().substring(0, 8);
return new Identity(user.identity.toUint8Array()).toHexString().substring(0, 8);
}
}

Expand All @@ -298,7 +298,7 @@ function setAllMessagesInOrder() {

client.current.on("initialStateSync", () => {
setAllMessagesInOrder();
var user = User.filterByIdentity(local_identity?.current?.toUint8Array()!);
var user = User.filterByIdentity(local_identity?.current!);
setName(userNameOrIdentity(user!));
});
```
Expand Down