@@ -122,7 +122,7 @@ elements.openServiceBtn.onclick = () => {
122122 . value as ServiceId ;
123123
124124 if ( serviceId === 'vault' ) {
125- const view = openServiceOptionsElms . view . options [ openServiceOptionsElms . view . selectedIndex ] . value as
125+ const view = openServiceOptionsElms . vaultView . options [ openServiceOptionsElms . vaultView . selectedIndex ] . value as
126126 | 'services-list'
127127 | 'service-connection'
128128 | 'connection-setting'
@@ -163,14 +163,16 @@ elements.openServiceBtn.onclick = () => {
163163 }
164164 }
165165
166- if ( serviceId === 'myaccount-settings' ) {
167- const view = openServiceOptionsElms . view . options [ openServiceOptionsElms . view . selectedIndex ] . value as
168- | 'authorized-applications'
169- | 'change-language'
170- | 'email-preferences'
171- | 'delete-account'
172- | 'update-email'
173- | 'update-password' ;
166+ if ( serviceId === 'myaccount' ) {
167+ const view = openServiceOptionsElms . myAccountView . options [ openServiceOptionsElms . myAccountView . selectedIndex ]
168+ . value as
169+ | 'settings'
170+ | 'settings/authorized-applications'
171+ | 'settings/change-language'
172+ | 'settings/email-preferences'
173+ | 'settings/delete-account'
174+ | 'settings/update-email'
175+ | 'settings/update-password' ;
174176
175177 OpenServicesConfigsOptions = { view } ;
176178 }
@@ -197,23 +199,28 @@ elements.sendLoginLinkBtn.onclick = async () => {
197199 sendLoginLinkBtn . disabled = false ;
198200} ;
199201
200- // Helper, to switch the vault options, depends on openService's serviceId value
202+ // Helper, to switch the options, depends on openService's serviceId value
201203elements . openServiceOptionsElms . serviceId . onchange = ( ) => {
202- const { openServiceOptionsElms, vaultOptions } = elements ;
204+ const { openServiceOptionsElms, pageVaultOptions , pageMyAccountOptions } = elements ;
203205 const selectedValue = openServiceOptionsElms . serviceId . options [ openServiceOptionsElms . serviceId . selectedIndex ] . value ;
204206
205- if ( selectedValue === 'vault' || selectedValue === 'myaccount-settings' ) {
206- vaultOptions . style . display = 'block' ;
207+ pageVaultOptions . style . display = 'none' ;
208+ pageMyAccountOptions . style . display = 'none' ;
209+
210+ if ( selectedValue === 'vault' ) {
211+ pageVaultOptions . style . display = 'block' ;
212+ return ;
213+ }
214+ if ( selectedValue === 'myaccount' ) {
215+ pageMyAccountOptions . style . display = 'block' ;
207216 return ;
208217 }
209-
210- vaultOptions . style . display = 'none' ;
211218} ;
212219
213220// Helper, To switch the options, depends on openService's view value for vault
214- elements . openServiceOptionsElms . view . onchange = ( ) => {
221+ elements . openServiceOptionsElms . vaultView . onchange = ( ) => {
215222 const { openServiceOptionsElms } = elements ;
216- const selectedValue = openServiceOptionsElms . view . options [ openServiceOptionsElms . view . selectedIndex ] . value ;
223+ const selectedValue = openServiceOptionsElms . vaultView . options [ openServiceOptionsElms . vaultView . selectedIndex ] . value ;
217224
218225 const vaultServicesElms = document . getElementsByClassName ( 'vault-services' ) ;
219226 for ( let indx = 0 ; indx < vaultServicesElms . length ; indx ++ ) {
0 commit comments