Skip to content

Commit

Permalink
fix bug with first repo add - fix #76
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanjudis committed Aug 18, 2016
1 parent 8973bae commit 4317cba
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,15 @@ function createWindow( event, hash ) {
rpc.on( 'add repo', ( repoPath ) => {
repoUtils.readRepoData( repoPath )
.then( repo => {
const repos = [ ...settings.get( 'repos' ), repo ];
const savedRepos = settings.get( 'repos' ) || [];
const repos = [ ...savedRepos, repo ];

settings.set( 'repos', repos );

emitAll( 'repos updated', repos );
} )
.catch( () => {
.catch( ( error ) => {
console.log( error )
// TODO put error handling here
} );
} );
Expand Down

0 comments on commit 4317cba

Please # to comment.