@@ -841,38 +841,30 @@ function uploadApp(app, options) {
841841        if  ( appJSON )  { 
842842          device . appsInstalled . push ( appJSON ) ; 
843843        } 
844-         showToast ( formatAppName ( app ) +   '  Uploaded!' ,  'success' ) ; 
844+         showToast ( ` ${ Utils . formatAppName ( app ) }   Uploaded!` ,  'success' ) ; 
845845      } ) . catch ( err  =>  { 
846-         showToast ( " Upload of"   + formatAppName ( app ) + "  failed" ,   +  err ,  'error' ) ; 
846+         showToast ( ` Upload of  ${ Utils . formatAppName ( app ) }   failed` ,   +  err ,  'error' ) ; 
847847      } ) ; 
848848  } ) ) ; 
849849} 
850- /** Format app name into a string like App Name (AppID)*/ 
851- function  formatAppName ( app ) { 
852-   //check if id is the same as the name, in which case we can just return the name... 
853-   if ( app . name . trim ( ) . toLowerCase ( ) === app . id . trim ( ) . toLowerCase ( ) ) { 
854-     return  app . name ; 
855-   } else { 
856-     return  formatAppName ( app ) ; 
857-   } 
858- } 
850+ 
859851/** Prompt user and then remove app from the device */ 
860852function  removeApp ( app )  { 
861-   return  showPrompt ( "Delete" ,  " Are you sure you want to delete " + formatAppName ( app ) + "?" ) 
853+   return  showPrompt ( "Delete" ,  ` Are you sure you want to delete ${ Utils . formatAppName ( app ) } ?` ) 
862854    . then ( ( )  =>  startOperation ( {  name : "Remove App"  } ,  ( )  =>  getInstalledApps ( ) 
863855      . then ( ( ) =>  Comms . removeApp ( device . appsInstalled . find ( a  =>  a . id  ===  app . id ) ) )  // a = from appid.info, app = from apps.json 
864856      . then ( ( ) => { 
865857        device . appsInstalled  =  device . appsInstalled . filter ( a => a . id != app . id ) ; 
866-         showToast ( formatAppName ( app ) + "  removed successfully" , "success" ) ; 
858+         showToast ( ` ${ Utils . formatAppName ( app ) }   removed successfully` , "success" ) ; 
867859      } ,  err => { 
868-         showToast ( " Removal of " + formatAppName ( app ) + "  failed, " + err , "error" ) ; 
860+         showToast ( ` Removal of ${ Utils . formatAppName ( app ) }   failed, ${ err } ` , "error" ) ; 
869861      } ) ) ) ; 
870862} 
871863
872864/** Show window for a new app and finally upload it */ 
873865function  customApp ( app )  { 
874866  return  handleCustomApp ( app ) . then ( ( )  =>  { 
875-     showToast ( formatAppName ( ) + "  Uploaded!" ,  "success" ) ; 
867+     showToast ( ` ${ Utils . formatAppName ( ) }   Uploaded!` ,  "success" ) ; 
876868    refreshMyApps ( ) ; 
877869    refreshLibrary ( ) ; 
878870  } ) . catch ( err  =>  { 
@@ -960,13 +952,13 @@ function updateApp(app, options) {
960952    remove . data  =  AppInfo . makeDataString ( data ) 
961953    return  Comms . removeApp ( remove ,  { containsFileList :true ,  noReset :options . noReset ,  noFinish :options . noFinish } ) ; 
962954  } ) . then ( ( ) => { 
963-     showToast ( " Updating " + formatAppName ( app ) + " ..." ) ; 
955+     showToast ( ` Updating ${ Utils . formatAppName ( app ) }  ...` ) ; 
964956    device . appsInstalled  =  device . appsInstalled . filter ( a => a . id != app . id ) ; 
965957    return  checkDependencies ( app , { checkForClashes :false } ) ; 
966958  } ) . then ( ( ) => Comms . uploadApp ( app , { device :device , language :LANGUAGE , noReset :options . noReset ,  noFinish :options . noFinish } ) 
967959  ) . then ( ( appJSON )  =>  { 
968960    if  ( appJSON )  device . appsInstalled . push ( appJSON ) ; 
969-     showToast ( formatAppName ( app ) + "  Updated!" ,  "success" ) ; 
961+     showToast ( ` ${ Utils . formatAppName ( app ) }   Updated!` ,  "success" ) ; 
970962  } ) ) ; 
971963} 
972964
0 commit comments