@@ -841,30 +841,38 @@ function uploadApp(app, options) {
841841 if ( appJSON ) {
842842 device . appsInstalled . push ( appJSON ) ;
843843 }
844- showToast ( app . name + ' Uploaded!' , 'success' ) ;
844+ showToast ( formatAppName ( app ) + ' Uploaded!' , 'success' ) ;
845845 } ) . catch ( err => {
846- showToast ( ' Upload failed, ' + err , 'error' ) ;
846+ showToast ( " Upload of" + formatAppName ( app ) + " failed" , + err , 'error' ) ;
847847 } ) ;
848848 } ) ) ;
849849}
850-
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+ }
851859/** Prompt user and then remove app from the device */
852860function removeApp ( app ) {
853- return showPrompt ( "Delete" , "Really remove '" + app . name + "' ?")
861+ return showPrompt ( "Delete" , "Are you sure you want to delete " + formatAppName ( app ) + " ?")
854862 . then ( ( ) => startOperation ( { name : "Remove App" } , ( ) => getInstalledApps ( )
855863 . then ( ( ) => Comms . removeApp ( device . appsInstalled . find ( a => a . id === app . id ) ) ) // a = from appid.info, app = from apps.json
856864 . then ( ( ) => {
857865 device . appsInstalled = device . appsInstalled . filter ( a => a . id != app . id ) ;
858- showToast ( app . name + " removed successfully" , "success" ) ;
866+ showToast ( formatAppName ( app ) + " removed successfully" , "success" ) ;
859867 } , err => {
860- showToast ( app . name + " removal failed, "+ err , "error" ) ;
868+ showToast ( "Removal of " + formatAppName ( app ) + " failed, "+ err , "error" ) ;
861869 } ) ) ) ;
862870}
863871
864872/** Show window for a new app and finally upload it */
865873function customApp ( app ) {
866874 return handleCustomApp ( app ) . then ( ( ) => {
867- showToast ( app . name + " Uploaded!" , "success" ) ;
875+ showToast ( formatAppName ( ) + " Uploaded!" , "success" ) ;
868876 refreshMyApps ( ) ;
869877 refreshLibrary ( ) ;
870878 } ) . catch ( err => {
@@ -952,13 +960,13 @@ function updateApp(app, options) {
952960 remove . data = AppInfo . makeDataString ( data )
953961 return Comms . removeApp ( remove , { containsFileList :true , noReset :options . noReset , noFinish :options . noFinish } ) ;
954962 } ) . then ( ( ) => {
955- showToast ( ` Updating ${ app . name } ...` ) ;
963+ showToast ( " Updating " + formatAppName ( app ) + "..." ) ;
956964 device . appsInstalled = device . appsInstalled . filter ( a => a . id != app . id ) ;
957965 return checkDependencies ( app , { checkForClashes :false } ) ;
958966 } ) . then ( ( ) => Comms . uploadApp ( app , { device :device , language :LANGUAGE , noReset :options . noReset , noFinish :options . noFinish } )
959967 ) . then ( ( appJSON ) => {
960968 if ( appJSON ) device . appsInstalled . push ( appJSON ) ;
961- showToast ( app . name + " Updated!" , "success" ) ;
969+ showToast ( formatAppName ( app ) + " Updated!" , "success" ) ;
962970 } ) ) ;
963971}
964972
@@ -1162,7 +1170,7 @@ function installMultipleApps(appIds, promptName) {
11621170 } ) . then ( ( ) => Comms . setTime ( )
11631171 ) . then ( ( ) => Comms . showUploadFinished ( )
11641172 ) . then ( ( ) => {
1165- showToast ( "Apps successfully installed!", "success" ) ;
1173+ showToast ( appCount + " apps successfully installed!", "success" ) ;
11661174 return getInstalledApps ( true ) ;
11671175 } ) ;
11681176}
0 commit comments