angular.module('beam.controllers')
  .controller('beamSettingsController', function($scope, configService) {

    this.save = function() {
      configService.set('host', $scope.settings.host);
      configService.set('tls', $scope.settings.tls === undefined ? false : $scope.settings.tls);
      configService.set('nick', $scope.settings.nick);
      var channels = $scope.settings.channels.map(function(item) {
        return item.text;
      });

      configService.set('channels', channels);
      if ($scope.settings.advanced) {
        configService.set('port', $scope.settings.port);
        configService.set('user', $scope.settings.user);
        configService.set('real', $scope.settings.real);
        configService.set('ignoreSecure', $scope.settings.ignoreSecure);
      } else {
        configService.set('port', $scope.settings.tls ? 6697 : 6667);
      }

      configService.save();
      require('ipc').send('welcome-done', true);
    };
  });

@@ -242,51 +242,16 @@
 tls 
-=== undefined ? false : $scope.settings.tls
+%7C%7C false
 );%0A 
@@ -324,16 +324,85 @@
 annels =
+ %5B%5D;%0A      if ($scope.settings.channels != null) %7B%0A        channels =
  $scope.
@@ -448,16 +448,18 @@
         
+  
 return i
@@ -474,19 +474,29 @@
 ;%0A      
+  
 %7D);
+%0A      %7D
 %0A%0A      
@@ -685,16 +685,26 @@
 ngs.user
+ %7C%7C 'beam'
 );%0A     
@@ -752,16 +752,29 @@
 ngs.real
+ %7C%7C 'Beam.io'
 );%0A     
@@ -838,16 +838,25 @@
 reSecure
+ %7C%7C false
 );%0A     

Fix map undefined issue in welcome dialogue