@@ -20,7 +20,7 @@ import {
2020 CliPromptType
2121} from '@shared/types/prompt-types'
2222import { use_is_landscape } from '../hooks/use-is-landscape'
23- import { use_update_check } from './hooks/use-update-check'
23+ import { UpdateInfo } from '. ./hooks/use-update-check'
2424import { UpdateAvailable as UiUpdateAvailable } from '@ui/components/editor/prompt-view/UpdateAvailable'
2525
2626type Props = {
@@ -36,6 +36,7 @@ type Props = {
3636 web_prompt_type : WebPromptType
3737 api_prompt_type : ApiPromptType
3838 cli_prompt_type : CliPromptType
39+ update_info : UpdateInfo
3940}
4041
4142export const Home : React . FC < Props > = ( props ) => {
@@ -71,8 +72,6 @@ export const Home: React.FC<Props> = (props) => {
7172 is_disabled : is_landscape
7273 } )
7374
74- const update_info = use_update_check ( props . version , props . is_active )
75-
7675 const header_targets_ref = useRef < HTMLDivElement > ( null )
7776
7877 const discord_label = 'Discord'
@@ -159,27 +158,27 @@ export const Home: React.FC<Props> = (props) => {
159158 </ div >
160159 )
161160
162- const update_section = update_info . is_available ? (
161+ const update_section = props . update_info . is_available ? (
163162 < >
164163 < div className = { styles . inner__update } >
165164 < UiUpdateAvailable
166165 on_update = { ( ) =>
167166 post_message ( props . vscode , { command : 'UPDATE_EXTENSION' } )
168167 }
169168 current_version = { props . version }
170- latest_version = { update_info . latest_version }
169+ latest_version = { props . update_info . latest_version }
171170 translations = { {
172171 title : t ( 'home.update.title' ) ,
173172 button : t ( 'home.update.button' ) ,
174- age : update_info . current_version_age_days ? (
173+ age : props . update_info . current_version_age_days ? (
175174 < Translation
176175 id = {
177- update_info . current_version_age_days === 1
176+ props . update_info . current_version_age_days === 1
178177 ? 'home.update.age.singular'
179178 : 'home.update.age'
180179 }
181180 components = { {
182- days : update_info . current_version_age_days . toString ( )
181+ days : props . update_info . current_version_age_days . toString ( )
183182 } }
184183 />
185184 ) : undefined ,
0 commit comments