From aa8c55df3faf2920330028e75bf9536a683c6414 Mon Sep 17 00:00:00 2001 From: blackspherefollower Date: Fri, 25 Oct 2024 21:04:18 +0100 Subject: [PATCH] fix: Correct the loading of the device-config when no user-config exists This fix also corrects order of the logging/DCM initialization. Fixes #157 --- .../device_configuration/user_device_configuration_cubit.dart | 3 --- lib/intiface_central_app.dart | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/bloc/device_configuration/user_device_configuration_cubit.dart b/lib/bloc/device_configuration/user_device_configuration_cubit.dart index f0d7c44..da435c1 100644 --- a/lib/bloc/device_configuration/user_device_configuration_cubit.dart +++ b/lib/bloc/device_configuration/user_device_configuration_cubit.dart @@ -28,9 +28,6 @@ class UserDeviceConfigurationCubit extends Cubit { Future loadConfig() async { try { - if (!IntifacePaths.userDeviceConfigFile.existsSync()) { - return; - } String? deviceConfig; String? userConfig; if (IntifacePaths.deviceConfigFile.existsSync()) { diff --git a/lib/intiface_central_app.dart b/lib/intiface_central_app.dart index 08fa09b..88d3bf7 100644 --- a/lib/intiface_central_app.dart +++ b/lib/intiface_central_app.dart @@ -275,9 +275,11 @@ class IntifaceCentralApp extends StatelessWidget with WindowListener { // Bring up the FFI now that we have logging available and crash logging set up. initializeApi(); + // Setup logging before initializing the DCM + var apiLog = NativeApiLog(); + var userConfigCubit = await UserDeviceConfigurationCubit.create(); - var apiLog = NativeApiLog(); apiLog.logMessageStream.listen((message) { var level = message.level; if (level == "DEBUG") {