Skip to content

Commit 59a061d

Browse files
committed
🔧 reset app state when user exit webxr
1 parent abbf389 commit 59a061d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/App/App.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ export const App = () => {
6767
optionalFeatures: ["dom-overlay", "local-floor"],
6868
domOverlay: { root: document.getElementById("overlay")! },
6969
})
70-
.then((webXRSession) =>
71-
setState({
72-
type: "webXR",
73-
webXRSession,
74-
})
75-
)
70+
.then((webXRSession) => {
71+
// reset to this state when user end session
72+
webXRSession.onend = () => setState({ type: "waiting-user-input" });
73+
74+
setState({ type: "webXR", webXRSession });
75+
})
7676
.catch(setError);
7777
};
7878

0 commit comments

Comments
 (0)