Skip to content

Commit 61d746e

Browse files
Update webview-ui/src/components/modes/ModesView.tsx
Type safety for slug Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
1 parent 2bdaff0 commit 61d746e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

webview-ui/src/components/modes/ModesView.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,9 @@ const ModesView = ({ onDone }: ModesViewProps) => {
478478
setShowImportDialog(false)
479479

480480
if (message.success) {
481-
const slug = (message as any).slug as string | undefined
481+
// Type safe access to slug
482+
type ImportModeResult = { type: 'importModeResult'; success: boolean; slug?: string; error?: string }
483+
const { slug } = message as ImportModeResult
482484
if (slug) {
483485
// Try switching using the freshest mode list available
484486
const all = getAllModes(customModesRef.current)

0 commit comments

Comments
 (0)