@use-stall/core 0.0.14 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -3
- package/dist/index.mjs +5 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -227,8 +227,8 @@ var get_recent_sync_logs = async (props) => {
|
|
|
227
227
|
};
|
|
228
228
|
var is_sync_queue_empty = async () => {
|
|
229
229
|
try {
|
|
230
|
-
const pending_items = await local_db.sync_queue.
|
|
231
|
-
return pending_items
|
|
230
|
+
const pending_items = await local_db.sync_queue.count();
|
|
231
|
+
return pending_items === 0;
|
|
232
232
|
} catch (error) {
|
|
233
233
|
console.error("Error checking sync queue status:", error);
|
|
234
234
|
return false;
|
|
@@ -319,7 +319,9 @@ var is_syncing = false;
|
|
|
319
319
|
var replace_temporary_ids = async (props) => {
|
|
320
320
|
const { table, stall_offline_id, connector_id } = props;
|
|
321
321
|
try {
|
|
322
|
-
const existing = await local_db[table].
|
|
322
|
+
const existing = await local_db[table].filter(
|
|
323
|
+
(record) => record.metadata?.stall_offline_id === stall_offline_id || record?.stall_offline_id === stall_offline_id
|
|
324
|
+
).first();
|
|
323
325
|
if (existing) {
|
|
324
326
|
await local_db[table].update(existing.id, {
|
|
325
327
|
id: connector_id
|
package/dist/index.mjs
CHANGED
|
@@ -160,8 +160,8 @@ var get_recent_sync_logs = async (props) => {
|
|
|
160
160
|
};
|
|
161
161
|
var is_sync_queue_empty = async () => {
|
|
162
162
|
try {
|
|
163
|
-
const pending_items = await local_db.sync_queue.
|
|
164
|
-
return pending_items
|
|
163
|
+
const pending_items = await local_db.sync_queue.count();
|
|
164
|
+
return pending_items === 0;
|
|
165
165
|
} catch (error) {
|
|
166
166
|
console.error("Error checking sync queue status:", error);
|
|
167
167
|
return false;
|
|
@@ -252,7 +252,9 @@ var is_syncing = false;
|
|
|
252
252
|
var replace_temporary_ids = async (props) => {
|
|
253
253
|
const { table, stall_offline_id, connector_id } = props;
|
|
254
254
|
try {
|
|
255
|
-
const existing = await local_db[table].
|
|
255
|
+
const existing = await local_db[table].filter(
|
|
256
|
+
(record) => record.metadata?.stall_offline_id === stall_offline_id || record?.stall_offline_id === stall_offline_id
|
|
257
|
+
).first();
|
|
256
258
|
if (existing) {
|
|
257
259
|
await local_db[table].update(existing.id, {
|
|
258
260
|
id: connector_id
|