@@ -50,12 +50,6 @@ export function CompositionsPanel({
50
50
} : CompositionsPanelProps ) {
51
51
// setup from props
52
52
const shouldAddNameParam = useNameParam || ( isScaling && includesEnvTemplate === false ) ;
53
- const handleSelect = useCallback (
54
- ( selected : Composition ) => {
55
- onSelect && onSelect ( selected ) ;
56
- } ,
57
- [ onSelect ]
58
- ) ;
59
53
60
54
// current composition state
61
55
const location = useLocation ( ) ;
@@ -70,6 +64,13 @@ export function CompositionsPanel({
70
64
const [ mounter , setMounter ] = useState < Window > ( ) ;
71
65
72
66
// composition navigation action
67
+ const handleSelect = useCallback (
68
+ ( selected : Composition ) => {
69
+ onSelect && onSelect ( selected ) ;
70
+ setControlsTimestamp ( 0 ) ;
71
+ } ,
72
+ [ onSelect ]
73
+ ) ;
73
74
const onCompositionCodeClicked = useCallback (
74
75
( composition : Composition ) => ( e : React . MouseEvent < HTMLDivElement > ) => {
75
76
e . preventDefault ( ) ;
@@ -95,6 +96,8 @@ export function CompositionsPanel({
95
96
setConsolesValues ( values ) ;
96
97
setControlsTimestamp ( timestamp ) ;
97
98
}
99
+ // LATER
100
+ // function onLiveControlsDestroy(e: MessageEvent<LiveControlReadyEventData>) {}
98
101
window . addEventListener ( 'message' , onLiveControlsSetup ) ;
99
102
return ( ) => {
100
103
window . removeEventListener ( 'message' , onLiveControlsSetup ) ;
0 commit comments