Skip to content

Commit

Permalink
fix: Add temp debug logs for VinciLoop
Browse files Browse the repository at this point in the history
  • Loading branch information
sfogfar committed Jul 16, 2024
1 parent 6e9aa47 commit 43221e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/state/automerge-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const initAppState = (
}
},
);
console.log("initAppState", appState);
return appState;
};

Expand All @@ -51,6 +52,7 @@ export async function changeState(
recreateState = false,
) {
appState = Automerge.change(appState, (s) => f(s as AppState));
console.log("changeState", appState);
// broadcast to all clients
await broadcast(appState.sessionId, appState, recreateState);
}
Expand All @@ -68,4 +70,5 @@ export function loadNewState(remoteRawState: string, recreateState: boolean) {
Automerge.init<AppState>({ patchCallback }),
remoteState,
);
console.log("loadNewState", appState);
}
1 change: 1 addition & 0 deletions src/app/state/reducers/app-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const changeDiscussCard = (changeType: "increment" | "decrement") => {

export const changeStage = (change: "next" | "back") => {
const currentStage = getAppState().stage ?? 0;
console.log("YAHA, currentStage:", currentStage);
if (currentStage <= 0 && change == "back") return;
if (currentStage >= Stage.End && change == "next") return;
return changeState((mutableState) => {
Expand Down

0 comments on commit 43221e5

Please sign in to comment.