2026-09-10 05:38:07 +00:00
|
|
|
// Module ID: 17965
|
|
|
|
|
// Function ID: 17966
|
|
|
|
|
// Name: BackgroundSync
|
|
|
|
|
// Dependencies: [5291, 502, 1895, 3, 2003, 17355, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
// Module 17965 (BackgroundSync)
|
|
|
|
|
import LoggerDefault from "Logger" /* 3 */;
|
|
|
|
|
import DatabaseManagerDefault from "DatabaseManager" /* 2003 */;
|
|
|
|
|
import background_sync_BackgroundSync from "background_sync/BackgroundSync" /* 17355 */;
|
|
|
|
|
import GatewayConnectionStore from "GatewayConnectionStore" /* 5291 */;
|
|
|
|
|
import AuthenticationStore from "AuthenticationStore" /* 502 */;
|
|
|
|
|
import AppStateStore from "AppStateStore" /* 1895 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
require = fn;
|
|
|
|
|
let closure_6 = new LoggerDefault("BackgroundSync");
|
|
|
|
|
const size = fn(2);
|
|
|
|
|
let result = size.fileFinishedImporting("modules/headless_tasks/android/BackgroundSync.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export default (arg0) => {
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_0 = arg0;
|
2026-09-10 05:38:07 +00:00
|
|
|
if ("active" === AppStateStore.getState()) {
|
2026-07-20 16:05:17 +00:00
|
|
|
let resolved = Promise.resolve();
|
|
|
|
|
} else {
|
2026-07-29 08:29:29 +00:00
|
|
|
if (!tmp) {
|
2026-09-10 05:38:07 +00:00
|
|
|
const result = DatabaseManagerDefault.carefullyOpenDatabase(AuthenticationStore.getId());
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
resolved = new Promise((arg0) => {
|
2026-09-10 05:38:07 +00:00
|
|
|
logger.log("Executing BackgroundSync with ", closure_0);
|
|
|
|
|
background_sync_BackgroundSync.backgroundSync({}).then(arg0);
|
2026-07-20 16:05:17 +00:00
|
|
|
});
|
2026-09-10 05:38:07 +00:00
|
|
|
tmp = GatewayConnectionStore.isConnected() || GatewayConnectionStore.isTryingToConnect();
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
return resolved;
|
|
|
|
|
};
|