isSynced method

Future<bool> isSynced()

check if data is synced

Implementation

Future<bool> isSynced() async {
  try {
    final result = await wpClient.evaluateJs(
      '''typeof window.WPP !== 'undefined' &&
           typeof window.WPP.conn.isSynced === 'function' &&
           window.WPP.conn.isSynced();''',
      tryPromise: false,
    );
    return result == true || result?.toString() == "true";
  } catch (e) {
    return false;
  }
}