chore(ts): drop two more redundant casts
- RouteMapThumbnail.client.tsx: `{ type: 'Feature', ... } as unknown
as GeoJsonObject` → `as GeoJsonObject`. The literal already
satisfies the type; the unknown bridge was unnecessary.
- use-yjs.ts:102: keep the coercion (y-websocket's `.on()` signature
doesn't include the legacy `"synced"` event even though the
runtime still fires it), but document why with a comment so future
readers don't try to drop it.
This commit is contained in:
parent
985ec54023
commit
a724f862b8
2 changed files with 5 additions and 1 deletions
|
|
@ -99,6 +99,10 @@ export function useYjs(
|
|||
|
||||
// Initialize waypoints once after first sync
|
||||
if (initialWaypoints?.length && !initializedWaypoints.current) {
|
||||
// y-websocket emits both "sync" and "synced" (legacy alias). We
|
||||
// keep "synced" for backwards-compat with older versions; the
|
||||
// typed `.on` signature in the current lib version omits it
|
||||
// even though the runtime still fires it, so we coerce.
|
||||
(provider as unknown as { on(event: string, cb: () => void): void }).on("synced", () => {
|
||||
// Only add if the doc is empty (avoid duplicating on reconnect)
|
||||
if (waypoints.length === 0 && !initializedWaypoints.current) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue