Skip to content

Commit

Permalink
Reset refinements: don't reset theme, more robust scene reset
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Jul 17, 2024
1 parent 2913c78 commit 527b951
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/viser/client/src/ControlPanel/GuiState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,12 @@ export function useGuiState(initialServer: string) {
}),
resetGui: () =>
set((state) => {
// No need to overwrite the theme or label. The former especially
// can be jarring.
// state.theme = cleanGuiState.theme;
// state.label = cleanGuiState.label;

// This feels brittle, could be cleaned up...
state.theme = cleanGuiState.theme;
state.label = cleanGuiState.label;
state.shareUrl = null;
state.guiIdSetFromContainerId = {};
state.modals = [];
Expand Down
4 changes: 2 additions & 2 deletions src/viser/client/src/SceneTreeState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ export function useSceneTreeState() {
if (key !== "" && key !== "/WorldAxes")
delete state.nodeFromName[key];
}
state.nodeFromName[""]!.children = ["/WorldAxes"];
state.nodeFromName["/WorldAxes"]!.children = [];
state.nodeFromName[""] = rootNodeTemplate;
state.nodeFromName["/WorldAxes"] = rootAxesNode;
}),
setLabelVisibility: (name, labelVisibility) =>
set((state) => {
Expand Down

0 comments on commit 527b951

Please sign in to comment.