Skip to content

Commit

Permalink
#219 - Ensured saving of webcams and remote settings also works via OE
Browse files Browse the repository at this point in the history
  • Loading branch information
Clon1998 committed Aug 17, 2023
1 parent 2c23680 commit cd3dcc3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
9 changes: 8 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# Mobileraker - Changelog

## [2.5.3] - 2023-08-16
## [2.5.4] - 2023-08-

### Bug Fixes

- Fixed missing resource for notification on Android preventing the delivery of push notifications
- Fixed issue on some devices that prevented the app from starting and required a reinstall

## [2.5.3] - 2023-08-16

### Bug Fixes

- Resolved an issue where saving webcam and remote settings was not working when the user was
connected via OE. [#219](https://github.com/Clon1998/mobileraker/issues/219)

## [2.5.2] - 2023-08-14

### Changed Features
Expand Down
20 changes: 5 additions & 15 deletions lib/ui/screens/printers/edit/printers_edit_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +96,13 @@ class PrinterEditController extends _$PrinterEditController {

Map<String, dynamic> storedValues = Map.unmodifiable(formBuilderState.value);

await _saveMachine(storedValues);
if (!isConnected) {
logger.i('Saved only local settings, machine was not connected via JRPC');
return; // If machine was not connected, no need to store remote data hence it was not shown in the first place!
}
var jrpcState = await ref.readWhere(jrpcClientStateProvider(_machine.uuid),
(c) => c == ClientState.connected || c == ClientState.error);
if (isConnected) {
logger.i('Can store remoteSettings, machine is connected!');

if (jrpcState == ClientState.error) {
throw const MobilerakerException(
'Unable to store remote settings, machine is not connected!');
await _saveWebcamInfos(storedValues);
await _saveMachineRemoteSettings(storedValues);
}
logger.i('Can store remoteSettings, machine is connected!');

await _saveWebcamInfos(storedValues);

await _saveMachineRemoteSettings(storedValues);
await _saveMachine(storedValues);
} on Error catch (e, s) {
state = false;
logger.e('Error while trying to save printer data', e, s);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 2.5.3+240
version: 2.5.4+240

environment:
sdk: '>=3.0.0 <4.0.0'
Expand Down

0 comments on commit cd3dcc3

Please sign in to comment.