mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-18 22:59:16 +00:00
fix: Server installation fixes
This commit is contained in:
parent
efed52f3ec
commit
acf2001c12
|
@ -21,7 +21,6 @@ class AddServerProviderToExistingServerFormCubit extends FormCubit {
|
|||
|
||||
@override
|
||||
FutureOr<void> onSubmit() async {
|
||||
// serverInstallationCubit.setServerProviderKey(apiKey.state.value);
|
||||
setServerProviderKey(apiKey.state.value);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pub_semver/pub_semver.dart';
|
||||
import 'package:selfprivacy/config/get_it_config.dart';
|
||||
|
@ -264,7 +263,7 @@ class ServerInstallationRepository {
|
|||
if (result.success && result.data != null) {
|
||||
server.copyWith(startTime: result.data);
|
||||
} else {
|
||||
getIt<NavigationService>().showSnackBar('jobs.reboot_failed'.tr());
|
||||
// getIt<NavigationService>().showSnackBar('jobs.reboot_failed'.tr());
|
||||
}
|
||||
|
||||
return server;
|
||||
|
|
|
@ -409,7 +409,9 @@ class DigitalOceanServerProvider extends ServerProvider {
|
|||
final String location,
|
||||
) async {
|
||||
final bool apiInitialized = _adapter.api().isWithToken;
|
||||
if (!apiInitialized) {
|
||||
final String token = _adapter._api.token;
|
||||
|
||||
if (!apiInitialized || token.isEmpty) {
|
||||
return GenericResult(
|
||||
success: true,
|
||||
data: false,
|
||||
|
@ -417,10 +419,11 @@ class DigitalOceanServerProvider extends ServerProvider {
|
|||
);
|
||||
}
|
||||
|
||||
// _adapter = ApiAdapter(
|
||||
// isWithToken: true,
|
||||
// region: location,
|
||||
// );
|
||||
_adapter = ApiAdapter(
|
||||
isWithToken: true,
|
||||
region: location,
|
||||
token: token,
|
||||
);
|
||||
return success;
|
||||
}
|
||||
|
||||
|
|
|
@ -428,7 +428,8 @@ class HetznerServerProvider extends ServerProvider {
|
|||
final String location,
|
||||
) async {
|
||||
final bool apiInitialized = _adapter.api().isWithToken;
|
||||
if (!apiInitialized) {
|
||||
final String token = _adapter._api.token;
|
||||
if (!apiInitialized || token.isEmpty) {
|
||||
return GenericResult(
|
||||
success: true,
|
||||
data: false,
|
||||
|
@ -439,7 +440,9 @@ class HetznerServerProvider extends ServerProvider {
|
|||
_adapter = ApiAdapter(
|
||||
isWithToken: true,
|
||||
region: location,
|
||||
token: token,
|
||||
);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue