mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-08 17:11:14 +00:00
refactor: Remove usesBinds from ApiServerVolumeCubit
This commit is contained in:
parent
bdd00683cd
commit
9bfaf5d381
|
@ -35,7 +35,6 @@ class ApiServerVolumeCubit
|
|||
ApiServerVolumeState(
|
||||
this.state._volumes,
|
||||
this.state.status,
|
||||
this.state.usesBinds,
|
||||
DiskStatus.fromVolumes(this.state._volumes, state.volumes),
|
||||
),
|
||||
);
|
||||
|
@ -44,7 +43,6 @@ class ApiServerVolumeCubit
|
|||
|
||||
Future<void> reload() async {
|
||||
final volumes = await serverApi.getServerDiskVolumes();
|
||||
final usesBinds = await serverApi.isUsingBinds();
|
||||
var status = LoadingStatus.error;
|
||||
|
||||
if (volumes.isNotEmpty) {
|
||||
|
@ -55,7 +53,6 @@ class ApiServerVolumeCubit
|
|||
ApiServerVolumeState(
|
||||
volumes,
|
||||
status,
|
||||
usesBinds,
|
||||
DiskStatus.fromVolumes(
|
||||
volumes,
|
||||
providerVolumeCubit.state.volumes,
|
||||
|
|
|
@ -4,16 +4,14 @@ class ApiServerVolumeState extends ServerInstallationDependendState {
|
|||
const ApiServerVolumeState(
|
||||
this._volumes,
|
||||
this.status,
|
||||
this.usesBinds,
|
||||
this._diskStatus,
|
||||
);
|
||||
|
||||
ApiServerVolumeState.initial()
|
||||
: this(const [], LoadingStatus.uninitialized, null, DiskStatus());
|
||||
: this(const [], LoadingStatus.uninitialized, DiskStatus());
|
||||
|
||||
final List<ServerDiskVolume> _volumes;
|
||||
final DiskStatus _diskStatus;
|
||||
final bool? usesBinds;
|
||||
final LoadingStatus status;
|
||||
|
||||
List<DiskVolume> get volumes => _diskStatus.diskVolumes;
|
||||
|
@ -27,16 +25,14 @@ class ApiServerVolumeState extends ServerInstallationDependendState {
|
|||
ApiServerVolumeState copyWith({
|
||||
final List<ServerDiskVolume>? volumes,
|
||||
final LoadingStatus? status,
|
||||
final bool? usesBinds,
|
||||
final DiskStatus? diskStatus,
|
||||
}) =>
|
||||
ApiServerVolumeState(
|
||||
volumes ?? _volumes,
|
||||
status ?? this.status,
|
||||
usesBinds ?? this.usesBinds,
|
||||
diskStatus ?? _diskStatus,
|
||||
);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [_volumes, status, usesBinds];
|
||||
List<Object?> get props => [_volumes, status];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue