Skip to content

Commit

Permalink
Use lower case assetCode in frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddasol committed Jun 13, 2023
1 parent c246a04 commit 413ed6a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/Contexts/AssetContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export const AssetProvider: FC<Props> = ({ children }) => {
const [assetCode, setAsset] = useState(previousAsset || defaultAsset.assetCode)

const switchAsset = (selectedAsset: string) => {
setAsset(selectedAsset)
window.localStorage.setItem('assetString', selectedAsset)
setAsset(selectedAsset.toLowerCase())
window.localStorage.setItem('assetString', selectedAsset.toLowerCase())
}

return (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function AssetPicker(page: string) {
options={Array.from(mappedOptions.keys()).sort()}
label=""
disabled={page === 'mission'}
initialSelectedOptions={[assetCode]}
initialSelectedOptions={[assetCode.toUpperCase()]}
placeholder={TranslateText('Select asset')}
onOptionsChange={({ selectedItems }) => {
const mapKey = mappedOptions.get(selectedItems[0])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function RobotStatusSection({ refreshInterval }: RefreshProps) {

var filteredRobots = robots.filter(function (robot) {
return (
robot.currentAsset === assetCode.toLowerCase() ||
robot.currentAsset === assetCode ||
(typeof robot.currentAsset === 'string' && robot.currentAsset.includes('default')) ||
robot.currentAsset === undefined
)
Expand Down

0 comments on commit 413ed6a

Please sign in to comment.