Skip to content

Commit

Permalink
edits from ry <3
Browse files Browse the repository at this point in the history
  • Loading branch information
jhaaaa committed Aug 22, 2023
1 parent f9e4c72 commit 6bba453
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 42 deletions.
12 changes: 1 addition & 11 deletions docs/build/local-first.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ export interface Conversation {
title: string | undefined;
createdAt: Date;
updatedAt: Date;
isGroup: boolean;
peerAddress: string;
groupMembers?: string[] | undefined;
}

// Define a message interface
Expand Down Expand Up @@ -130,9 +127,6 @@ class DB extends Dexie {
title,
createdAt,
updatedAt,
isGroup,
groupMembers,
peerAddress
`,
messages: `
++id,
Expand Down Expand Up @@ -243,9 +237,7 @@ When a new message is received, update the `updatedAt` timestamp of the related
// Check if the conversation needs to be updated
if (conversation && conversation.updatedAt < updatedAt) {
// If it does, update the updatedAt timestamp
await conversationMutex.runExclusive(async () => {
await db.conversations.update(conversation, { updatedAt });
});
await db.conversations.update(conversation, { updatedAt });
}
```

Expand All @@ -261,8 +253,6 @@ const conversation: Conversation = {
title: undefined,
createdAt: xmtpConversation.createdAt,
updatedAt: xmtpConversation.createdAt,
isGroup: xmtpConversation.isGroup,
peerAddress: xmtpConversation.peerAddress,
};

// Save the conversation to the database and get its ID
Expand Down
27 changes: 0 additions & 27 deletions docs/build/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,33 +309,6 @@ val messages = conversation.messages(limit = 25)
val nextPage = conversation.messages(limit = 25, before = messages[0].sent)
```

</TabItem>
<TabItem value="react" label="React" attributes={{className: "react_tab"}}>

```tsx
import { useMessages } from "@xmtp/react-sdk";

const { error, isLoading, messages, next } = useMessages(
conversation,
options: {
limit: 20,
},
);
const handleClick = useCallback(() => {
// fetch next page of messages
next();
}, [next]);


return (

<button type="button" onClick={handleClick}>
Load more messages
</button>

);
```

</TabItem>
<TabItem value="rn" label="React Native" attributes={{className: "rn_tab"}}>

Expand Down
2 changes: 1 addition & 1 deletion docs/content-types/react-content-types.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_label: For React
sidebar_label: React SDK
sidebar_position: 1.5
---

Expand Down
4 changes: 1 addition & 3 deletions docs/content-types/remote-attachment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ xmtp.registerCodec(new RemoteAttachmentCodec());
### Create an attachment object

<Tabs>
<TabItem value="frontend" label="Frontend" attributes={{className: "react_tab"}}>
<TabItem value="javascript" label="JavaScript" attributes={{className: "js_tab"}}>

```tsx
const arrayBuffer = await file.arrayBuffer();

// Local file details
const attachment = {
filename: filename,
Expand Down

0 comments on commit 6bba453

Please sign in to comment.