Skip to content

Commit

Permalink
Merge pull request #171 from OP-Engineering/oscar/libsql-sync-interva…
Browse files Browse the repository at this point in the history
…l-default-value

Give sync interval a default value on libsql
  • Loading branch information
ospfranco authored Oct 23, 2024
2 parents 10003f4 + 9640a74 commit bdb0925
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cpp/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,11 @@ void install(jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> invoker,
std::string url = options.getProperty(rt, "url").asString(rt).utf8(rt);
std::string auth_token =
options.getProperty(rt, "authToken").asString(rt).utf8(rt);
int sync_interval =
static_cast<int>(options.getProperty(rt, "syncInterval").asNumber());
int sync_interval = 0;
if (options.hasProperty(rt, "syncInterval")) {
sync_interval =
static_cast<int>(options.getProperty(rt, "syncInterval").asNumber());
}
std::string location;

if (options.hasProperty(rt, "location")) {
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ type OPSQLiteProxy = {
authToken: string;
name: string;
location?: string;
syncInterval?: number;
}) => DB;
isSQLCipher: () => boolean;
isLibsql: () => boolean;
Expand Down

0 comments on commit bdb0925

Please sign in to comment.