-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Canvas reset should reset remix route (#4203)
* Canvas reset should reset remix route * fix(remix) Only update navigationData on completed navigation and clear on canvas reset --------- Co-authored-by: RheeseyB <[email protected]>
- Loading branch information
Showing
3 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { useAtom } from 'jotai' | ||
import React from 'react' | ||
import { RemixNavigationAtom } from './utopia-remix-root-component' | ||
import { AlwaysFalse, usePubSubAtomReadOnly } from '../../../core/shared/atom-with-pub-sub' | ||
import { UiJsxCanvasCtxAtom } from '../ui-jsx-canvas' | ||
|
||
export function useResetRemixApps() { | ||
const [_, setNavigationData] = useAtom(RemixNavigationAtom) | ||
let uiJsxCanvasContext = usePubSubAtomReadOnly(UiJsxCanvasCtxAtom, AlwaysFalse) | ||
return React.useCallback(() => { | ||
setNavigationData({}) | ||
uiJsxCanvasContext.current.spyValues.metadata = {} | ||
}, [setNavigationData, uiJsxCanvasContext]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters