Skip to content

Commit bbfbdc2

Browse files
committed
fix(examples/to-do-app): correctly validate CONNECTION_STRING before initializing cloudsync
1 parent 2053c2e commit bbfbdc2

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

examples/to-do-app/app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"expo": {
33
"name": "todoapp",
44
"slug": "todoapp",
5-
"version": "1.0.1",
5+
"version": "1.0.2",
66
"orientation": "portrait",
77
"icon": "./assets/icon.png",
88
"userInterfaceStyle": "light",

examples/to-do-app/hooks/useCategories.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,9 @@ const useCategories = () => {
5959
await db.execute('INSERT OR IGNORE INTO tags (uuid, name) VALUES (?, ?)', [randomUUID(), 'Work'])
6060
await db.execute('INSERT OR IGNORE INTO tags (uuid, name) VALUES (?, ?)', [randomUUID(), 'Personal'])
6161

62-
if (CONNECTION_STRING.startsWith('sqlitecloud://')) {
62+
if (CONNECTION_STRING && CONNECTION_STRING.startsWith('sqlitecloud://')) {
6363
await db.execute(`SELECT cloudsync_network_init('${CONNECTION_STRING}');`);
6464
} else {
65-
console.warn(CONNECTION_STRING)
6665
throw new Error('No valid CONNECTION_STRING provided, cloudsync_network_init will not be called');
6766
}
6867

examples/to-do-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sqliteai/todoapp",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "An Expo template for building apps with the SQLite CloudSync extension",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)