Skip to content

Commit

Permalink
If no valid devices data is obtained, the device library data still n…
Browse files Browse the repository at this point in the history
…eeds to be generated.
  • Loading branch information
zhengyangliu committed Dec 21, 2024
1 parent 5514f7c commit 8d8186b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/lib/vm-listener-hoc.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ const vmListenerHOC = function (WrappedComponent) {
this.props.vm.postIOData('userData', {username: this.props.username});
// Update device list
this.props.vm.extensionManager.getDeviceList().then(data => {
if (data) {
this.props.onSetDeviceData(makeDeviceLibrary(data));
}
});
this.props.onSetDeviceData(makeDeviceLibrary(data));
})
.catch(() => {
this.props.onSetDeviceData(makeDeviceLibrary());
});
}
componentDidUpdate (prevProps) {
if (prevProps.username !== this.props.username) {
Expand Down

0 comments on commit 8d8186b

Please sign in to comment.