fix: correct seek() off-by-one, clear selfWrites map, fix README dependency

This commit is contained in:
vitalii.semianchuk
2026-07-15 20:13:27 +01:00
parent da52e172e1
commit e58bf712d2
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ view.playAnimation()
### Flutter
```yaml
dependencies:
lottie: ^latest
lottie: ^1.0.0
```
```dart
+1 -1
View File
@@ -298,7 +298,7 @@ export function CanvasProvider(props: { children: JSX.Element }) {
const togglePlayback = () => setPlaying((v) => !v);
const seek = (frame: number) => {
setCurrentFrame(Math.max(0, Math.min(frame, totalFrames())))
setCurrentFrame(Math.max(0, Math.min(frame, totalFrames() - 1)))
dirty = true;
};
+4 -1
View File
@@ -403,7 +403,10 @@ export function scenesPlugin(): Plugin {
} catch {
return;
}
if (selfWrites.get(file) === content) return; // echo of our own save — ignore
if (selfWrites.get(file) === content) {
selfWrites.delete(file);
return; // echo of our own save — ignore
}
const rel = path.relative(projectsDir, file).split(path.sep).join("/");
server.ws.send({ type: "custom", event: "scene:source", data: { lottie: `/projects/${rel}` } });
});