Closed qwerty084 closed 1 year ago
Thanks!
Uncaught TypeError: brush is undefined (svg.ts:87)
Somewhere along the way the possibility of brush being undefined must have been ignored/lost, or else this error should have been caught at compile time. Let's fix that, too.
Sorry for the delay. Merged now.
I also refreshed my understanding of the drawing code, and tweaked it a bit more: 8eef51cea368a1756e3fbaa327161e4f93b3dbca.
brush in DrawShape is currently typed as string | undefined. Passing undefined to brush crashes when using setShapes(): Uncaught TypeError: brush is undefined (svg.ts:87) So it should be atleast string type.
I also added the available colors to the brush property, from state.ts. Because if you pass black as a string it just crashes. It would be nice if the available colors are in the type.