@saltcorn/mobile-app 0.8.6-beta.15 → 0.8.6-beta.17

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@saltcorn/mobile-app",
3
3
  "displayName": "Saltcorn mobile app",
4
- "version": "0.8.6-beta.15",
4
+ "version": "0.8.6-beta.17",
5
5
  "description": "Apache Cordova application with @saltcorn/markup",
6
6
  "main": "index.js",
7
7
  "scripts": {
package/www/index.html CHANGED
@@ -179,6 +179,7 @@
179
179
 
180
180
  // the app comes back from background
181
181
  const onResume = async () => {
182
+ if (!saltcorn?.data?.state) return;
182
183
  const state = saltcorn.data.state.getState();
183
184
  const mobileConfig = state.mobileConfig;
184
185
  if (mobileConfig?.allowOfflineMode) {
@@ -34,7 +34,10 @@ async function updateScTables(tablesJSON, skipScPlugins = true) {
34
34
  // pick fields that really exist
35
35
  const insertRow = {};
36
36
  for (const safeField of existingFields) {
37
- if (row[safeField]) insertRow[safeField] = row[safeField];
37
+ const fromRow = row[safeField];
38
+ if (fromRow !== null && fromRow !== undefined) {
39
+ insertRow[safeField] = fromRow;
40
+ }
38
41
  }
39
42
  await saltcorn.data.db.insert(table, insertRow);
40
43
  }