fix
This commit is contained in:
@@ -257,19 +257,8 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
||||
: undefined,
|
||||
});
|
||||
|
||||
async ensureBatteryOptimizationIgnored() {
|
||||
if (Platform.OS !== 'android') return;
|
||||
try {
|
||||
const mod = NativeModules.ProxyServiceModule;
|
||||
if (!mod) return;
|
||||
const ignored = await mod.isBatteryOptimizationIgnored();
|
||||
if (!ignored) await mod.requestIgnoreBatteryOptimization();
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
async startProxyClient() {
|
||||
try {
|
||||
await this.ensureBatteryOptimizationIgnored();
|
||||
this.clientId = DeviceInfo.getUniqueIdSync();
|
||||
const userId = Api.instance.getUserId();
|
||||
this.setState({ proxyStatus: 'connecting' });
|
||||
|
||||
Reference in New Issue
Block a user