Skip to content

Commit

Permalink
Merge pull request #354 from SotSF/send-websocket-update-state
Browse files Browse the repository at this point in the history
Send state update when selected pattern changes
  • Loading branch information
brollin authored Jan 16, 2025
2 parents ffacec9 + ce3b6fd commit 27cadb4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/types/PlaygroundStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from "@/src/types/PatternParams";
import type { Store } from "@/src/types/Store";
import { deserializeVariation } from "@/src/types/Variations/variations";
import { sendConjurerStateUpdate } from "@/src/websocket/conjurerApiWebsocket";
import { makeAutoObservable } from "mobx";

export class PlaygroundStore {
Expand All @@ -23,6 +24,9 @@ export class PlaygroundStore {
}
set selectedPatternIndex(index: number) {
this._selectedPatternIndex = index;

if (process.env.NEXT_PUBLIC_NODE_ENV !== "production")
sendConjurerStateUpdate(this.store);
}

_selectedEffectIndices: number[] = [];
Expand Down

0 comments on commit 27cadb4

Please sign in to comment.