@@ -7,7 +7,7 @@ import { Dropdown } from '../common/Dropdown';
7
7
import { Account } from './Account' ;
8
8
import { createAccountOptions } from 'ui/util/dropdown' ;
9
9
import type { DropdownOption , DropdownProps , ValidFormField } from 'types' ;
10
- import { useApi , useDatabase } from 'ui/contexts' ;
10
+ import { useApi , useDatabase , useVersion } from 'ui/contexts' ;
11
11
import { classes } from 'lib/util' ;
12
12
import { useDbQuery } from 'ui/hooks' ;
13
13
@@ -43,15 +43,21 @@ function Select({
43
43
44
44
export function AccountSelect ( { placeholder = 'Select account' , ...props } : Props ) {
45
45
const { accounts } = useApi ( ) ;
46
+ const { version } = useVersion ( ) ;
46
47
47
48
return (
48
- < Select options = { createAccountOptions ( accounts || [ ] ) } placeholder = { placeholder } { ...props } />
49
+ < Select
50
+ options = { createAccountOptions ( accounts || [ ] , version ) }
51
+ placeholder = { placeholder }
52
+ { ...props }
53
+ />
49
54
) ;
50
55
}
51
56
52
57
export function AddressSelect ( { placeholder = 'Select account' , onChange, ...props } : Props ) {
53
58
const { accounts } = useApi ( ) ;
54
59
const { db } = useDatabase ( ) ;
60
+ const { version } = useVersion ( ) ;
55
61
const [ contracts ] = useDbQuery ( ( ) => db . contracts . toArray ( ) , [ db ] ) ;
56
62
const [ recent , setRecent ] = useState < DropdownOption < string > [ ] > ( [ ] ) ;
57
63
@@ -63,7 +69,7 @@ export function AddressSelect({ placeholder = 'Select account', onChange, ...pro
63
69
} ,
64
70
{
65
71
label : 'My Accounts' ,
66
- options : createAccountOptions ( accounts || [ ] ) ,
72
+ options : createAccountOptions ( accounts || [ ] , version ) ,
67
73
} ,
68
74
{
69
75
label : 'Uploaded Contracts' ,
0 commit comments