Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qbxdo minor fixes #1001

Merged
merged 2 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions app/lib/pages/memory_capturing/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ class _MemoryCapturingPageState extends State<MemoryCapturingPage> with TickerPr
WidgetsBinding.instance.addPostFrameCallback((_) {
final captureProvider = context.read<CaptureProvider>();
if (captureProvider.segments.isNotEmpty) {
setState(() {
_elapsedTime = convertDateTimeToSeconds(captureProvider.inProgressMemory!.createdAt);
});
if (captureProvider.inProgressMemory != null) {
setState(() {
_elapsedTime = convertDateTimeToSeconds(captureProvider.inProgressMemory!.createdAt);
});
}
Comment on lines +40 to +44
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The null check added here is a good practice to prevent potential NullPointer exceptions. However, it's important to note that if captureProvider.inProgressMemory is null, _elapsedTime will not be updated. If this is the expected behavior, then the change is fine. Otherwise, you might want to add some error handling or a default value for _elapsedTime.

+        if (captureProvider.inProgressMemory != null) {
             setState(() {
               _elapsedTime = convertDateTimeToSeconds(captureProvider.inProgressMemory!.createdAt);
             });
+        } else {
+            // Handle the case when inProgressMemory is null
+            // For example, set a default value or throw an exception
+        }

Please ensure that this change aligns with your intended logic.

_startTimer();
}
});
Expand Down
2 changes: 1 addition & 1 deletion app/lib/providers/capture_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CaptureProvider extends ChangeNotifier

ServerMemory? get inProgressMemory => _inProgressMemory;

bool _walFeatureEnabled = true;
bool _walFeatureEnabled = false;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

Changing the _walFeatureEnabled from true to false might have significant implications if other parts of the code rely on this feature being enabled. Ensure that this change doesn't break any functionality or introduce bugs elsewhere in the application.

- bool _walFeatureEnabled = false;
+ bool _walFeatureEnabled = true;

Please provide more context or reasoning behind this change in the PR description to help reviewers understand its impact.

IWalService get _walService => ServiceManager.instance().wal;
IDeviceService get _deviceService => ServiceManager.instance().device;

Expand Down
2 changes: 1 addition & 1 deletion app/lib/providers/speech_profile_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SpeechProfileProvider extends ChangeNotifier
bool loading = false;
BtDevice? device;

final targetWordsCount = 15;
final targetWordsCount = 70;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The targetWordsCount has been increased from 15 to 70. This is a significant increase and could potentially impact the performance of the application, especially if it's used in loops or recursive functions. Please ensure that this change doesn't negatively affect the app's performance.

- final targetWordsCount = 15;
+ final targetWordsCount = 70;

final maxDuration = 90;
StreamSubscription<OnConnectionStateChangedEvent>? connectionStateListener;
List<TranscriptSegment> segments = [];
Expand Down
Loading