@@ -320,7 +320,7 @@ function handleCustomApp(appTemplate) {
320320 if ( ! appTemplate . custom ) throw new Error ( "App doesn't have custom HTML" ) ;
321321 // if it needs a connection, do that first
322322 if ( appTemplate . customConnect && ! device . connected )
323- return getDeviceInfo ( ) . then ( ( ) => handleCustomApp ( appTemplate ) ) ;
323+ return getInstalledApps ( ) . then ( ( ) => handleCustomApp ( appTemplate ) ) ;
324324 // otherwise continue
325325 return new Promise ( ( resolve , reject ) => {
326326 let modal = htmlElement ( `<div class="modal active">
@@ -358,7 +358,7 @@ function handleCustomApp(appTemplate) {
358358 console . log ( "Received custom app" , app ) ;
359359 modal . remove ( ) ;
360360
361- getDeviceInfo ( )
361+ getInstalledApps ( )
362362 . then ( ( ) => checkDependencies ( app ) )
363363 . then ( ( ) => Comms . uploadApp ( app , { device :device , language :LANGUAGE , noFinish : msg . options && msg . options . noFinish } ) )
364364 . then ( ( ) => {
@@ -745,7 +745,7 @@ function showScreenshots(appId) {
745745// =========================================== My Apps
746746
747747function uploadApp ( app ) {
748- return getDeviceInfo ( ) . then ( ( ) => {
748+ return getInstalledApps ( ) . then ( ( ) => {
749749 if ( device . appsInstalled . some ( i => i . id === app . id ) ) {
750750 return updateApp ( app ) ;
751751 }
@@ -774,7 +774,7 @@ function uploadApp(app) {
774774
775775function removeApp ( app ) {
776776 return showPrompt ( "Delete" , "Really remove '" + app . name + "'?" ) . then ( ( ) => {
777- return getDeviceInfo ( ) . then ( ( ) => {
777+ return getInstalledApps ( ) . then ( ( ) => {
778778 // a = from appid.info, app = from apps.json
779779 return Comms . removeApp ( device . appsInstalled . find ( a => a . id === app . id ) ) ;
780780 } ) ;
@@ -983,7 +983,7 @@ function refreshMyApps() {
983983}
984984
985985let haveInstalledApps = false ;
986- function getDeviceInfo ( refresh ) {
986+ function getInstalledApps ( refresh ) {
987987 if ( haveInstalledApps && ! refresh ) {
988988 return Promise . resolve ( device . appsInstalled ) ;
989989 }
@@ -1093,7 +1093,7 @@ function installMultipleApps(appIds, promptName) {
10931093 ) . then ( ( ) => Comms . showUploadFinished ( )
10941094 ) . then ( ( ) => {
10951095 showToast ( "Apps successfully installed!" , "success" ) ;
1096- return getDeviceInfo ( true ) ;
1096+ return getInstalledApps ( true ) ;
10971097 } ) ;
10981098}
10991099
@@ -1139,7 +1139,7 @@ function handleConnectionChange(connected) {
11391139}
11401140
11411141htmlToArray ( document . querySelectorAll ( ".btn.refresh" ) ) . map ( button => button . addEventListener ( "click" , ( ) => {
1142- getDeviceInfo ( true ) . catch ( err => {
1142+ getInstalledApps ( true ) . catch ( err => {
11431143 showToast ( "Getting app list failed, " + err , "error" ) ;
11441144 } ) ;
11451145} ) ) ;
@@ -1152,7 +1152,7 @@ connectMyDeviceBtn.addEventListener("click", () => {
11521152 const deviceInfoElem = document . getElementById ( "more-deviceinfo" ) ;
11531153 if ( deviceInfoElem ) deviceInfoElem . style . display = "none" ;
11541154 } else {
1155- getDeviceInfo ( true ) . catch ( err => {
1155+ getInstalledApps ( true ) . catch ( err => {
11561156 showToast ( "Device connection failed, " + err , "error" ) ;
11571157 Comms . disconnectDevice ( ) ;
11581158 } ) ;
@@ -1272,7 +1272,7 @@ if (btn) btn.addEventListener("click",event=>{
12721272 Progress . hide ( { sticky :true } ) ;
12731273 device . appsInstalled = [ ] ;
12741274 showToast ( "All apps removed" , "success" ) ;
1275- return getDeviceInfo ( true ) ;
1275+ return getInstalledApps ( true ) ;
12761276 } ) . catch ( err => {
12771277 Progress . hide ( { sticky :true } ) ;
12781278 showToast ( "App removal failed, " + err , "error" ) ;
@@ -1308,7 +1308,7 @@ if (btn) btn.addEventListener("click", event => {
13081308
13091309btn = document . getElementById ( "screenshot" ) ;
13101310if ( btn ) btn . addEventListener ( "click" , event => {
1311- getDeviceInfo ( false ) . then ( ( ) => {
1311+ getInstalledApps ( false ) . then ( ( ) => {
13121312 if ( device . id == "BANGLEJS" ) {
13131313 showPrompt ( "Screenshot" , "Screenshots are not supported on Bangle.js 1" , { ok :1 } ) ;
13141314 } else {
0 commit comments