@@ -213,16 +213,9 @@ class UI {
213213
214214 if ( typeOfList !== undefined && typeOfList === TypeListEnum . ToDay ) {
215215 if ( restrictionList !== undefined && restrictionList . length > 0 ) {
216- var item = restrictionList . find ( x => x . url . isMatch ( tab . url ) ) ;
217- if ( item !== undefined ) {
218- var divLimit = this . createElement ( 'div' , [ 'tooltip' , 'inline-block' ] ) ;
219- var limitIcon = this . createElement ( 'img' , [ 'margin-left-5' , 'tooltip' ] ) ;
220- limitIcon . height = 15 ;
221- limitIcon . src = '/icons/limit.png' ;
222- var tooltip = this . createElement ( 'span' , [ 'tooltiptext' ] , "Daily limit is " + convertShortSummaryTimeToLongString ( item . time ) ) ;
223- divLimit = this . appendChild ( divLimit , [ limitIcon , tooltip ] ) ;
224- spanUrl . appendChild ( divLimit ) ;
225- }
216+ this . addRestrictionIcon ( tab , restrictionList , spanUrl ) ;
217+ } else {
218+ getLimitsListFromStorage ( ( ) => this . addRestrictionIcon ( tab , restrictionList , spanUrl ) ) ;
226219 }
227220 }
228221
@@ -242,6 +235,19 @@ class UI {
242235 this . getTableOfSite ( ) . appendChild ( div ) ;
243236 }
244237
238+ addRestrictionIcon ( tab , restrictions , spanUrl ) {
239+ var item = restrictions . find ( x => x . url . isMatch ( tab . url ) ) ;
240+ if ( item !== undefined ) {
241+ var divLimit = this . createElement ( 'div' , [ 'tooltip' , 'inline-block' ] ) ;
242+ var limitIcon = this . createElement ( 'img' , [ 'margin-left-5' , 'tooltip' ] ) ;
243+ limitIcon . height = 15 ;
244+ limitIcon . src = '/icons/limit.png' ;
245+ var tooltip = this . createElement ( 'span' , [ 'tooltiptext' ] , "Daily limit is " + convertShortSummaryTimeToLongString ( item . time ) ) ;
246+ divLimit = this . appendChild ( divLimit , [ limitIcon , tooltip ] ) ;
247+ spanUrl . appendChild ( divLimit ) ;
248+ }
249+ }
250+
245251 createElementsForTotalTime ( summaryTime , typeOfList , parentElement ) {
246252 var arr = getArrayTime ( summaryTime ) ;
247253 var isNextPartActiv = false ;
0 commit comments