Skip to content

Commit af3f9e8

Browse files
committed
lil more
1 parent ce023c6 commit af3f9e8

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/app/Flash.jsx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ const errors = {
115115
},
116116
[ErrorCode.UNRECOGNIZED_DEVICE]: {
117117
status: 'Unrecognized device',
118-
description: 'The device connected to your computer is not supported. Try using a different cable, USB port, or ' +
119-
'computer. If the problem persists, join the #hw-three-3x channel on Discord for help.',
118+
description: 'The device connected to your computer is not supported. Try using a different cable, USB port, or computer.',
120119
bgColor: 'bg-yellow-500',
121120
icon: deviceQuestion,
121+
showDiscordHelp: true,
122122
},
123123
[ErrorCode.LOST_CONNECTION]: {
124124
status: 'Lost connection',
@@ -127,21 +127,21 @@ const errors = {
127127
},
128128
[ErrorCode.REPAIR_PARTITION_TABLES_FAILED]: {
129129
status: 'Repairing partition tables failed',
130-
description: 'Your device\'s partition tables could not be repaired. Try using a different cable, USB port, or ' +
131-
'computer. If the problem persists, join the #hw-three-3x channel on Discord for help.',
130+
description: 'Your device\'s partition tables could not be repaired. Try using a different cable, USB port, or computer.',
132131
icon: deviceExclamation,
132+
showDiscordHelp: true,
133133
},
134134
[ErrorCode.ERASE_FAILED]: {
135135
status: 'Erase failed',
136-
description: 'The device could not be erased. Try using a different cable, USB port, or computer. If the problem ' +
137-
'persists, join the #hw-three-3x channel on Discord for help.',
136+
description: 'The device could not be erased. Try using a different cable, USB port, or computer.',
138137
icon: deviceExclamation,
138+
showDiscordHelp: true,
139139
},
140140
[ErrorCode.FLASH_SYSTEM_FAILED]: {
141141
status: 'Flash failed',
142-
description: 'Try using a different cable, USB port, or computer. If ' +
143-
'the problem persists, join the #hw-three-3x channel on Discord for help.',
142+
description: 'Try using a different cable, USB port, browser, or computer.',
144143
icon: deviceExclamation,
144+
showDiscordHelp: true,
145145
},
146146
}
147147

@@ -673,13 +673,19 @@ export default function Flash() {
673673
if (error) {
674674
Object.assign(uiState, errors[ErrorCode.UNKNOWN], errors[error])
675675
}
676-
let { status, description, bgColor = 'bg-gray-400', icon = bolt, iconStyle = 'invert', hideRetry = false } = uiState
676+
let { status, description, bgColor = 'bg-gray-400', icon = bolt, iconStyle = 'invert', hideRetry = false, showDiscordHelp = false } = uiState
677677

678678
// Add qcserial hint for Linux + comma 3/3X only
679679
if (error === ErrorCode.LOST_CONNECTION && isLinux && selectedDevice === DeviceType.COMMA_3) {
680680
description += ' Did you forget to unbind the device from qcserial?'
681681
}
682682

683+
// Build Discord help link based on device type
684+
const discordChannel = selectedDevice === DeviceType.COMMA_4 ? 'hw-four' : 'hw-three-3x'
685+
const discordLink = showDiscordHelp && (
686+
<> If the problem persists, join <a href="https://discord.comma.ai" target="_blank" rel="noopener noreferrer" className="text-blue-500 hover:underline font-semibold">#{discordChannel}</a> on Discord for help.</>
687+
)
688+
683689
let title
684690
if (message && !error) {
685691
title = message + '...'
@@ -724,10 +730,10 @@ export default function Flash() {
724730
<LinearProgress value={progress * 100} barColor={bgColor} />
725731
</div>
726732
<span className="text-3xl font-mono font-light">{title}</span>
727-
<span className="text-xl px-8 max-w-xl text-center">{description}</span>
733+
<span className="text-xl px-8 max-w-xl text-center">{description}{discordLink}</span>
728734
{error !== ErrorCode.NONE && !hideRetry && (
729735
<button
730-
className="px-4 py-2 rounded-md bg-gray-200 hover:bg-gray-300 text-gray-800 transition-colors"
736+
className="px-8 py-3 text-xl font-semibold rounded-full bg-[#51ff00] hover:bg-[#45e000] active:bg-[#3acc00] text-black transition-colors"
731737
onClick={handleRetry}
732738
>
733739
Retry

0 commit comments

Comments
 (0)