Skip to content

Commit a7a0f52

Browse files
laurensvalkdlech
authored andcommitted
firmware/alerts: Show correct instructions for Linux.
Also link to pybricks website for udev rules instead.
1 parent b6575c5 commit a7a0f52

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/app/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const pybricksUsbDfuTroubleshootingUrl =
4646
'https://github.com/pybricks/support/discussions/688';
4747

4848
export const pybricksUsbLinuxUdevRulesUrl =
49-
'https://github.com/pybricks/support/discussions/688#discussioncomment-3239099';
49+
'https://pybricks.com/projects/tutorials/dev/tools/linux/';
5050

5151
/** Pybricks copyright statement. */
5252
export const pybricksCopyright = 'Copyright (c) 2020-2023 The Pybricks Authors';

src/firmware/alerts/NoDfuHub.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33

44
import { AnchorButton, Button, Intent } from '@blueprintjs/core';
55
import React from 'react';
6-
import { pybricksUsbDfuTroubleshootingUrl } from '../../app/constants';
6+
import {
7+
pybricksUsbDfuTroubleshootingUrl,
8+
pybricksUsbLinuxUdevRulesUrl,
9+
} from '../../app/constants';
710
import ExternalLinkIcon from '../../components/ExternalLinkIcon';
811
import type { CreateToast } from '../../toasterTypes';
912
import { isLinux, isWindows } from '../../utils/os';
@@ -30,6 +33,16 @@ const NoDfuHub: React.VoidFunctionComponent<NoDfuHubProps> = ({
3033
{i18n.translate('noDfuHub.installUsbDriverButton')}
3134
</Button>
3235
)}
36+
{isLinux() && (
37+
<AnchorButton
38+
icon="help"
39+
href={pybricksUsbLinuxUdevRulesUrl}
40+
target="_blank"
41+
>
42+
{i18n.translate('noDfuHub.configureUdevRulesButton')}
43+
<ExternalLinkIcon />
44+
</AnchorButton>
45+
)}
3346
<AnchorButton
3447
icon="help"
3548
href={pybricksUsbDfuTroubleshootingUrl}

src/firmware/alerts/translations/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"linux": "You may need to add udev rules before you can connect to your hub."
1616
},
1717
"troubleshootButton": "Troubleshooting Tips",
18-
"installUsbDriverButton": "Install USB Driver"
18+
"installUsbDriverButton": "Install USB Driver",
19+
"configureUdevRulesButton": "Configure udev rules"
1920
},
2021
"noDfuInterface": {
2122
"message": "This is very unusual. The USB device did not contain the expected interface."

0 commit comments

Comments
 (0)