@@ -87,12 +87,12 @@ function checkBrowserFeatures(featureList) {
8787 console . error ( "Cannot check features - Modernizr global is missing." ) ;
8888 return false ;
8989 }
90- var featureComplete = true ;
91- for ( var i = 0 ; i < featureList . length ; i ++ ) {
90+ let featureComplete = true ;
91+ for ( let i = 0 ; i < featureList . length ; i ++ ) {
9292 if ( window . Modernizr [ featureList [ i ] ] === undefined ) {
9393 console . error (
9494 "Looked for feature '%s' but Modernizr has no results for this. " +
95- "Has it been configured correctly?" , featureList [ i ]
95+ "Has it been configured correctly?" , featureList [ i ] ,
9696 ) ;
9797 return false ;
9898 }
@@ -113,7 +113,7 @@ function getScreenFromLocation(location) {
113113 return {
114114 screen : fragparts . location . substring ( 1 ) ,
115115 params : fragparts . params ,
116- }
116+ } ;
117117}
118118
119119// Here, we do some crude URL analysis to allow
@@ -138,10 +138,10 @@ function onHashChange(ev) {
138138// so a web page can update the URL bar appropriately.
139139function onNewScreen ( screen ) {
140140 console . log ( "newscreen " + screen ) ;
141- var hash = '#/' + screen ;
141+ const hash = '#/' + screen ;
142142 lastLocationHashSet = hash ;
143143 window . location . hash = hash ;
144- } ;
144+ }
145145
146146// We use this to work out what URL the SDK should
147147// pass through when registering to allow the user to
@@ -214,9 +214,9 @@ function onTokenLoginCompleted() {
214214 // if we did a token login, we're now left with the token, hs and is
215215 // url as query params in the url; a little nasty but let's redirect to
216216 // clear them.
217- var parsedUrl = url . parse ( window . location . href ) ;
217+ const parsedUrl = url . parse ( window . location . href ) ;
218218 parsedUrl . search = "" ;
219- var formatted = url . format ( parsedUrl ) ;
219+ const formatted = url . format ( parsedUrl ) ;
220220 console . log ( "Redirecting to " + formatted + " to drop loginToken " +
221221 "from queryparams" ) ;
222222 window . location . href = formatted ;
@@ -293,7 +293,7 @@ async function loadApp() {
293293 // in case it is the first time loading Riot.
294294 // `InstallTrigger` is a Object which only exists on Firefox
295295 // (it is used for their Plugins) and can be used as a
296- // feature check.
296+ // feature check.
297297 // Firefox loads css always before js. This is why we dont use
298298 // onload or it's EventListener as thoose will never trigger.
299299 if ( typeof InstallTrigger !== 'undefined' ) {
@@ -345,19 +345,19 @@ async function loadApp() {
345345 initialScreenAfterLogin = { getScreenFromLocation ( window . location ) }
346346 defaultDeviceDisplayName = { platform . getDefaultDeviceDisplayName ( ) }
347347 /> ,
348- document . getElementById ( 'matrixchat' )
348+ document . getElementById ( 'matrixchat' ) ,
349349 ) ;
350350 } else {
351351 console . error ( "Browser is missing required features." ) ;
352352 // take to a different landing page to AWOOOOOGA at the user
353- var CompatibilityPage = sdk . getComponent ( "structures.CompatibilityPage" ) ;
353+ const CompatibilityPage = sdk . getComponent ( "structures.CompatibilityPage" ) ;
354354 window . matrixChat = ReactDOM . render (
355355 < CompatibilityPage onAccept = { function ( ) {
356356 if ( window . localStorage ) window . localStorage . setItem ( 'mx_accepts_unsupported_browser' , true ) ;
357357 console . log ( "User accepts the compatibility risks." ) ;
358358 loadApp ( ) ;
359359 } } /> ,
360- document . getElementById ( 'matrixchat' )
360+ document . getElementById ( 'matrixchat' ) ,
361361 ) ;
362362 }
363363}
0 commit comments