personal web client for Bluesky
typescript solidjs bluesky atcute

refactor: wrap focus in effect instead

mary.my.id 208578e2 07b5d717

verified
Changed files
+12 -10
src
views
+12 -10
src/views/main/explore.tsx
··· 74 74 75 75 <SearchBar 76 76 ref={(node) => { 77 - onCleanup( 78 - globalEvents.on('softreset', () => { 79 - if (isFocused()) { 80 - batch(() => { 81 - node.focus(); 82 - setIsInputFocused(true); 83 - }); 84 - } 85 - }), 86 - ); 77 + createEffect(() => { 78 + if (isFocused()) { 79 + onCleanup( 80 + globalEvents.on('softreset', () => { 81 + batch(() => { 82 + node.focus(); 83 + setIsInputFocused(true); 84 + }); 85 + }), 86 + ); 87 + } 88 + }); 87 89 }} 88 90 /> 89 91