@saltcorn/mobile-app 0.9.6-beta.19 → 0.9.6-beta.20

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.9.6-beta.19",
4
+ "version": "0.9.6-beta.20",
5
5
  "description": "Apache Cordova application with @saltcorn/markup",
6
6
  "main": "index.js",
7
7
  "scripts": {
@@ -138,9 +138,9 @@ const getView = async (context) => {
138
138
  );
139
139
  }
140
140
  state.queriesCache = {};
141
- let contents = null;
141
+ let contents0 = null;
142
142
  try {
143
- contents = await view.run_possibly_on_page(
143
+ contents0 = await view.run_possibly_on_page(
144
144
  query,
145
145
  req,
146
146
  res,
@@ -157,5 +157,25 @@ const getView = async (context) => {
157
157
  context,
158
158
  req
159
159
  );
160
- else return wrapContents(contents, viewname, context, req);
160
+ else {
161
+ const contents =
162
+ typeof contents0 === "string"
163
+ ? saltcorn.markup.div(
164
+ {
165
+ class: "d-inline",
166
+ "data-sc-embed-viewname": view.name,
167
+ "data-sc-view-source": `/view/${context.params.viewname}${
168
+ context.query
169
+ ? context.query.startsWith("?")
170
+ ? context.query
171
+ : `?${context.query}`
172
+ : ""
173
+ }`,
174
+ },
175
+ contents0
176
+ )
177
+ : contents0;
178
+
179
+ return wrapContents(contents, viewname, context, req);
180
+ }
161
181
  };