fix: app crashes on select cloud model first time onboarding #4470
+39
−31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe Your Changes
Fixed an issue where the app would crash if the user clicked on the cloud model during the first time of onboarding.
Changes
This pull request includes changes to improve the handling of engine settings and filtering logic in the
RemoteEngineSettings
andOnDeviceStarterScreen
components. The most important changes include adding a null check for theengine
variable and filtering engines by type before mapping them.Improvements to engine settings handling:
web/screens/Settings/Engines/RemoteEngineSettings.tsx
: Added a null check for theengine
variable to return null if the engine is not defined.Enhancements to filtering logic:
web/screens/Thread/ThreadCenterPanel/ChatBody/OnDeviceStarterScreen/index.tsx
: Added a filter to only include engines of type 'remote' before mapping them in theOnDeviceStarterScreen
component.