Skip to content

Use MarkerType enum instead of as any cast in store.ts #45

@johnkozaris

Description

@johnkozaris

Problem

In store.ts line 575, flashMessageEdge creates an edge with:

markerEnd: { type: 'arrowclosed' as any, color: getAccentColor(), width: 16, height: 16 },

The as any cast bypasses TypeScript's type checking for the React Flow MarkerType enum. This is fragile — if React Flow changes the marker type values or API, the error will be silently swallowed.

Fix

Import and use the MarkerType enum from @xyflow/react:

import { MarkerType } from '@xyflow/react';

// ...
markerEnd: { type: MarkerType.ArrowClosed, color: getAccentColor(), width: 16, height: 16 },

Files

  • src/renderer/store.ts:575

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions