Commit 38d0f2c
authored
🤖 fix: show disabled voice button with HTTPS tooltip on insecure contexts (#838)
_Generated with mux_
When accessing mux over HTTP (non-localhost), `navigator.mediaDevices`
is undefined due to browser security restrictions. Previously this
caused a crash or hidden button.
Now shows a disabled mic button with tooltip: "Voice input requires a
secure connection. Use HTTPS or access via localhost."
Changes:
- Add `requiresSecureContext` flag to `useVoiceInput` hook
- Show disabled button with educational tooltip instead of
hiding/crashing
- Prioritize HTTPS message over API key message (check HTTPS first)1 parent 537020e commit 38d0f2c
File tree
3 files changed
+28
-6
lines changed- src/browser
- components/ChatInput
- hooks
3 files changed
+28
-6
lines changedLines changed: 20 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
33 | 42 | | |
34 | 43 | | |
35 | 44 | | |
| |||
40 | 49 | | |
41 | 50 | | |
42 | 51 | | |
43 | | - | |
| 52 | + | |
44 | 53 | | |
45 | 54 | | |
46 | 55 | | |
| |||
52 | 61 | | |
53 | 62 | | |
54 | 63 | | |
55 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
56 | 71 | | |
57 | 72 | | |
58 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1070 | 1070 | | |
1071 | 1071 | | |
1072 | 1072 | | |
| 1073 | + | |
1073 | 1074 | | |
1074 | 1075 | | |
1075 | 1076 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
131 | 135 | | |
132 | 136 | | |
133 | 137 | | |
| 138 | + | |
134 | 139 | | |
135 | 140 | | |
136 | 141 | | |
| |||
237 | 242 | | |
238 | 243 | | |
239 | 244 | | |
240 | | - | |
| 245 | + | |
241 | 246 | | |
242 | 247 | | |
| 248 | + | |
243 | 249 | | |
244 | 250 | | |
245 | 251 | | |
| |||
0 commit comments