@@ -320,7 +320,7 @@ function handleCustomApp(appTemplate) {
320
320
if ( ! appTemplate . custom ) throw new Error ( "App doesn't have custom HTML" ) ;
321
321
// if it needs a connection, do that first
322
322
if ( appTemplate . customConnect && ! device . connected )
323
- return getDeviceInfo ( ) . then ( ( ) => handleCustomApp ( appTemplate ) ) ;
323
+ return getInstalledApps ( ) . then ( ( ) => handleCustomApp ( appTemplate ) ) ;
324
324
// otherwise continue
325
325
return new Promise ( ( resolve , reject ) => {
326
326
let modal = htmlElement ( `<div class="modal active">
@@ -358,7 +358,7 @@ function handleCustomApp(appTemplate) {
358
358
console . log ( "Received custom app" , app ) ;
359
359
modal . remove ( ) ;
360
360
361
- getDeviceInfo ( )
361
+ getInstalledApps ( )
362
362
. then ( ( ) => checkDependencies ( app ) )
363
363
. then ( ( ) => Comms . uploadApp ( app , { device :device , language :LANGUAGE , noFinish : msg . options && msg . options . noFinish } ) )
364
364
. then ( ( ) => {
@@ -745,7 +745,7 @@ function showScreenshots(appId) {
745
745
// =========================================== My Apps
746
746
747
747
function uploadApp ( app ) {
748
- return getDeviceInfo ( ) . then ( ( ) => {
748
+ return getInstalledApps ( ) . then ( ( ) => {
749
749
if ( device . appsInstalled . some ( i => i . id === app . id ) ) {
750
750
return updateApp ( app ) ;
751
751
}
@@ -774,7 +774,7 @@ function uploadApp(app) {
774
774
775
775
function removeApp ( app ) {
776
776
return showPrompt ( "Delete" , "Really remove '" + app . name + "'?" ) . then ( ( ) => {
777
- return getDeviceInfo ( ) . then ( ( ) => {
777
+ return getInstalledApps ( ) . then ( ( ) => {
778
778
// a = from appid.info, app = from apps.json
779
779
return Comms . removeApp ( device . appsInstalled . find ( a => a . id === app . id ) ) ;
780
780
} ) ;
@@ -983,7 +983,7 @@ function refreshMyApps() {
983
983
}
984
984
985
985
let haveInstalledApps = false ;
986
- function getDeviceInfo ( refresh ) {
986
+ function getInstalledApps ( refresh ) {
987
987
if ( haveInstalledApps && ! refresh ) {
988
988
return Promise . resolve ( device . appsInstalled ) ;
989
989
}
@@ -1093,7 +1093,7 @@ function installMultipleApps(appIds, promptName) {
1093
1093
) . then ( ( ) => Comms . showUploadFinished ( )
1094
1094
) . then ( ( ) => {
1095
1095
showToast ( "Apps successfully installed!" , "success" ) ;
1096
- return getDeviceInfo ( true ) ;
1096
+ return getInstalledApps ( true ) ;
1097
1097
} ) ;
1098
1098
}
1099
1099
@@ -1139,7 +1139,7 @@ function handleConnectionChange(connected) {
1139
1139
}
1140
1140
1141
1141
htmlToArray ( document . querySelectorAll ( ".btn.refresh" ) ) . map ( button => button . addEventListener ( "click" , ( ) => {
1142
- getDeviceInfo ( true ) . catch ( err => {
1142
+ getInstalledApps ( true ) . catch ( err => {
1143
1143
showToast ( "Getting app list failed, " + err , "error" ) ;
1144
1144
} ) ;
1145
1145
} ) ) ;
@@ -1152,7 +1152,7 @@ connectMyDeviceBtn.addEventListener("click", () => {
1152
1152
const deviceInfoElem = document . getElementById ( "more-deviceinfo" ) ;
1153
1153
if ( deviceInfoElem ) deviceInfoElem . style . display = "none" ;
1154
1154
} else {
1155
- getDeviceInfo ( true ) . catch ( err => {
1155
+ getInstalledApps ( true ) . catch ( err => {
1156
1156
showToast ( "Device connection failed, " + err , "error" ) ;
1157
1157
Comms . disconnectDevice ( ) ;
1158
1158
} ) ;
@@ -1272,7 +1272,7 @@ if (btn) btn.addEventListener("click",event=>{
1272
1272
Progress . hide ( { sticky :true } ) ;
1273
1273
device . appsInstalled = [ ] ;
1274
1274
showToast ( "All apps removed" , "success" ) ;
1275
- return getDeviceInfo ( true ) ;
1275
+ return getInstalledApps ( true ) ;
1276
1276
} ) . catch ( err => {
1277
1277
Progress . hide ( { sticky :true } ) ;
1278
1278
showToast ( "App removal failed, " + err , "error" ) ;
@@ -1308,7 +1308,7 @@ if (btn) btn.addEventListener("click", event => {
1308
1308
1309
1309
btn = document . getElementById ( "screenshot" ) ;
1310
1310
if ( btn ) btn . addEventListener ( "click" , event => {
1311
- getDeviceInfo ( false ) . then ( ( ) => {
1311
+ getInstalledApps ( false ) . then ( ( ) => {
1312
1312
if ( device . id == "BANGLEJS" ) {
1313
1313
showPrompt ( "Screenshot" , "Screenshots are not supported on Bangle.js 1" , { ok :1 } ) ;
1314
1314
} else {
0 commit comments