Skip to content

Commit

Permalink
🔧 Remember last selected version
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrieseberg committed Aug 7, 2018
1 parent 0f1ff6a commit 58b252f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/renderer/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import { ipcRendererManager } from './ipc';
import { getKnownVersions, getUpdatedKnownVersions } from './versions';

const knownVersions = getKnownVersions();
const defaultVersion = normalizeVersion(knownVersions[0].tag_name);
const defaultVersion = localStorage.getItem('version')
|| normalizeVersion(knownVersions[0].tag_name);

/**
* Editors exist outside of React's world. To make things *a lot*
Expand Down Expand Up @@ -75,6 +76,7 @@ export class AppState {
autorun(() => localStorage.setItem('gitHubLogin', this.gitHubLogin || ''));
autorun(() => localStorage.setItem('gitHubName', this.gitHubName || ''));
autorun(() => localStorage.setItem('gitHubToken', this.gitHubToken || ''));
autorun(() => localStorage.setItem('version', this.version || ''));

// Update our known versions
getUpdatedKnownVersions().then((versions) => {
Expand Down

0 comments on commit 58b252f

Please sign in to comment.