File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
internal/server/web/static/js Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,9 @@ function tokenlistToHTML(tokenTrees, deleteClass) {
153153 tokenTrees . forEach ( function ( tokenTree ) {
154154 tableEntries = _tokenTreeToHTML ( tokenTree , deleteClass , 0 ) + tableEntries ;
155155 } ) ;
156+ if ( tableEntries === "" ) {
157+ tableEntries = `<tr><td colSpan="4" class="text-muted text-center">No subtokens</td></tr>` ;
158+ }
156159 return '<table class="table table-hover table-grey">' +
157160 '<thead><tr>' +
158161 '<th style="min-width: 50%;">Token Name</th>' +
@@ -207,7 +210,12 @@ function _getSubtokensInfo() {
207210 let copy = $ ( '#tree-copy' ) ;
208211 _tokeninfo ( 'subtokens' ,
209212 function ( res ) {
210- msg . html ( tokenlistToHTML ( [ res [ 'mytokens' ] ] , revocationClassFromSubtokens ) ) ;
213+ let token = res [ 'mytokens' ] ;
214+ let subtokens = [ ] ;
215+ if ( 'children' in token ) {
216+ subtokens = token [ 'children' ] ;
217+ }
218+ msg . html ( tokenlistToHTML ( subtokens , revocationClassFromSubtokens ) ) ;
211219 activateTokenList ( ) ;
212220 msg . removeClass ( 'text-danger' ) ;
213221 copy . addClass ( 'd-none' ) ;
You can’t perform that action at this time.
0 commit comments