Files
discord-decomp/modules/headless_tasks/android/BackgroundSync.tsx
T
2026-11-01 12:12:55 +02:00

24 lines
972 B
TypeScript

// Metro module 16766 (f16767).
import GatewayConnectionStore from "../../gateway/GatewayConnectionStore";
import AuthenticationStore from "../../../stores/AuthenticationStore";
import AppStateStore from "../../../stores/native/AppStateStore";
import Logger from "../../debug/Logger";
import DatabaseManager from "../../app_database/system/DatabaseManager";
import { backgroundSync } from "../../app_database/background_sync/native/BackgroundSync";
let c12075_6 = new Logger("BackgroundSync");
module.exports = (c23407_0) => {
let r27;
if (AppStateStore.getState() === "active") {
r27 = Promise.resolve();
} else {
if (!(GatewayConnectionStore.isConnected() || GatewayConnectionStore.isTryingToConnect())) {
DatabaseManager.carefullyOpenDatabase(AuthenticationStore.getId());
}
r27 = new Promise((resolve) => {
c12075_6.log("Executing BackgroundSync with ", c23407_0);
backgroundSync({}).then(resolve);
});
}
return r27;
};