fix
This commit is contained in:
@@ -257,19 +257,8 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
|||||||
: undefined,
|
: 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() {
|
async startProxyClient() {
|
||||||
try {
|
try {
|
||||||
await this.ensureBatteryOptimizationIgnored();
|
|
||||||
this.clientId = DeviceInfo.getUniqueIdSync();
|
this.clientId = DeviceInfo.getUniqueIdSync();
|
||||||
const userId = Api.instance.getUserId();
|
const userId = Api.instance.getUserId();
|
||||||
this.setState({ proxyStatus: 'connecting' });
|
this.setState({ proxyStatus: 'connecting' });
|
||||||
|
|||||||
Reference in New Issue
Block a user