Skip to content

Commit

Permalink
Make management lock codes nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
elibon99 committed Jan 8, 2025
1 parent 6f920d2 commit 30e3ff3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/android/management/state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class _AndroidManagementStateNotifier extends ManagementStateNotifier {

@override
Future<void> writeConfig(DeviceConfig config,
{String currentLockCode = '',
String newLockCode = '',
{String? currentLockCode,
String? newLockCode,
bool reboot = false}) async {
if (reboot) {
state = const AsyncValue.loading();
Expand Down
4 changes: 2 additions & 2 deletions lib/desktop/management/state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ class _DesktopManagementStateNotifier extends ManagementStateNotifier {

@override
Future<void> writeConfig(DeviceConfig config,
{String currentLockCode = '',
String newLockCode = '',
{String? currentLockCode,
String? newLockCode,
bool reboot = false}) async {
await _session.command('configure', target: _subpath, params: {
...config.toJson(),
Expand Down
4 changes: 1 addition & 3 deletions lib/management/state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ final managementStateProvider = AsyncNotifierProvider.autoDispose
abstract class ManagementStateNotifier
extends ApplicationStateNotifier<DeviceInfo> {
Future<void> writeConfig(DeviceConfig config,
{String currentLockCode = '',
String newLockCode = '',
bool reboot = false});
{String? currentLockCode, String? newLockCode, bool reboot = false});

Future<void> setMode({
required int interfaces,
Expand Down
2 changes: 1 addition & 1 deletion lib/management/views/management_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class _ManagementScreenState extends ConsumerState<ManagementScreen> {
widget.deviceData.info.config
.copyWith(enabledCapabilities: _enabled),
reboot: reboot,
currentLockCode: _lockCodeController.text);
currentLockCode: isLocked ? _lockCodeController.text : null);
if (!mounted) return;
Navigator.pop(context);
showMessage(context, l10n.s_config_updated);
Expand Down

0 comments on commit 30e3ff3

Please sign in to comment.