Skip to content

Commit b8f0153

Browse files
authored
chore: Removed last executeAsync usages in group-chat demo project. (#510)
1 parent b913180 commit b8f0153

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

demos/react-native-supabase-group-chat/src/app/(app)/(chats)/g/create.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ export default function CreateGroup() {
2626

2727
await powerSync.writeTransaction(async (tx) => {
2828
try {
29-
await tx.executeAsync('INSERT INTO groups (id, owner_id, name, created_at) VALUES (?, ?, ?, datetime())', [
29+
await tx.execute('INSERT INTO groups (id, owner_id, name, created_at) VALUES (?, ?, ?, datetime())', [
3030
groupId,
3131
user?.id,
3232
name
3333
]);
3434
for (const profileId of selectedContacts) {
3535
const membershipId = uuid();
36-
await tx.executeAsync(
36+
await tx.execute(
3737
'INSERT INTO memberships (id, group_id, profile_id, created_at) VALUES (?, ?, ?, datetime())',
3838
[membershipId, groupId, profileId]
3939
);

demos/react-native-supabase-group-chat/src/app/(app)/contacts/index.tsx

-15
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,6 @@ export default function ContactsIndex() {
4141
ownerId,
4242
profileId
4343
]);
44-
45-
/* await powerSync.writeTransaction(async (tx) => {
46-
try {
47-
tx.executeAsync(
48-
"INSERT INTO profiles (id, name, handle, demo) VALUES (?, ?, ?, ?)",
49-
[profileId, name, handle, true],
50-
);
51-
tx.executeAsync(
52-
"INSERT INTO contacts (id, owner_id, profile_id) VALUES (?, ?, ?)",
53-
[contactId, ownerId, profileId],
54-
);
55-
} catch (error) {
56-
console.error("Error", error);
57-
}
58-
}); */
5944
}
6045

6146
async function handleAddContact(profileId: string, name: string, handle: string) {

0 commit comments

Comments
 (0)