utils.js
/**
 * Loads all app settings from the system, loops through all specified
 * connections upserting them based on their `uuid` and then saves the app
 * settings back to the system.
 * @param {SFE_Connection[]} connections
 * @returns {SFE_AppSettings}
 */
Loads all app settings from the system, loops through all specified
connections upserting them based on their `uuid` and then saves the app
settings back to the system.
Loads all app settings from the system loops through all specified connections upserting them based on their ` uuid ` and then saves the app settings back to the system .
function saveConnections(connections) {
  const appSettings = globalThis.appSettings = loadAppSettings();
  for (const connection of connections) {
    let index = appSettings.connections.findIndex(c => c.uuid === connection.uuid);
    if (index < 0) {
      index = appSettings.connections.length;
    }
    appSettings.connections[index] = connection;
  }
  return saveAppSettings();
}
function saveConnections ( connections ) { const appSettings = globalThis . appSettings = loadAppSettings ( ) ; for ( const connection of connections ) { let index = appSettings . connections . findIndex ( c => c . uuid === connection . uuid ) ; if ( index < 0 ) { index = appSettings . connections . length ; } appSettings . connections [ index ] = connection ; } return saveAppSettings ( ) ; }
Loads all app settings from the system, loops through all specified
 connections upserting them based on their `uuid` and then saves the app
 settings back to the system.
Loads all app settings from the system loops through all specified connections upserting them based on their ` uuid ` and then saves the app settings back to the system .