@saltcorn/mobile-app 0.9.0-beta.9 → 0.9.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/package.json +1 -1
- package/www/js/utils/global_utils.js +23 -8
package/package.json
CHANGED
|
@@ -292,22 +292,37 @@ async function reload() {
|
|
|
292
292
|
async function goBack(steps = 1, exitOnFirstPage = false) {
|
|
293
293
|
const { inLoadState } = saltcorn.data.state.getState().mobileConfig;
|
|
294
294
|
if (inLoadState) return;
|
|
295
|
+
const iframe = document.getElementById("content-iframe");
|
|
295
296
|
if (
|
|
296
297
|
routingHistory.length === 0 ||
|
|
297
298
|
(exitOnFirstPage && routingHistory.length === 1)
|
|
298
299
|
) {
|
|
299
300
|
navigator.app.exitApp();
|
|
300
301
|
} else if (routingHistory.length <= steps) {
|
|
301
|
-
|
|
302
|
-
|
|
302
|
+
try {
|
|
303
|
+
if (iframe?.contentWindow?.showLoadSpinner)
|
|
304
|
+
iframe.contentWindow.showLoadSpinner();
|
|
305
|
+
routingHistory = [];
|
|
306
|
+
await handleRoute("/");
|
|
307
|
+
} finally {
|
|
308
|
+
if (iframe?.contentWindow?.removeLoadSpinner)
|
|
309
|
+
iframe.contentWindow.removeLoadSpinner();
|
|
310
|
+
}
|
|
303
311
|
} else {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
routingHistory.
|
|
312
|
+
try {
|
|
313
|
+
if (iframe?.contentWindow?.showLoadSpinner)
|
|
314
|
+
iframe.contentWindow.showLoadSpinner();
|
|
315
|
+
routingHistory = routingHistory.slice(0, routingHistory.length - steps);
|
|
316
|
+
// don't repeat a post
|
|
317
|
+
if (routingHistory[routingHistory.length - 1].route.startsWith("post/")) {
|
|
318
|
+
routingHistory.pop();
|
|
319
|
+
}
|
|
320
|
+
const newCurrent = routingHistory.pop();
|
|
321
|
+
await handleRoute(newCurrent.route, newCurrent.query);
|
|
322
|
+
} finally {
|
|
323
|
+
if (iframe?.contentWindow?.removeLoadSpinner)
|
|
324
|
+
iframe.contentWindow.removeLoadSpinner();
|
|
308
325
|
}
|
|
309
|
-
const newCurrent = routingHistory.pop();
|
|
310
|
-
await handleRoute(newCurrent.route, newCurrent.query);
|
|
311
326
|
}
|
|
312
327
|
}
|
|
313
328
|
|