diff --git a/spec/history-manager-spec.js b/spec/history-manager-spec.js index 7e62a69f4..7a06fce9b 100644 --- a/spec/history-manager-spec.js +++ b/spec/history-manager-spec.js @@ -31,7 +31,6 @@ describe("HistoryManager", () => { }) historyManager = new HistoryManager({stateStore, project, commands: commandRegistry}) - historyManager.initialize(window.localStorage) await historyManager.loadState() }) @@ -76,7 +75,7 @@ describe("HistoryManager", () => { it("saves the state", async () => { await historyManager.clearProjects() - const historyManager2 = new HistoryManager({stateStore, localStorage: window.localStorage, project, commands: commandRegistry}) + const historyManager2 = new HistoryManager({stateStore, project, commands: commandRegistry}) await historyManager2.loadState() expect(historyManager.getProjects().length).toBe(0) }) @@ -187,7 +186,7 @@ describe("HistoryManager", () => { it("saves the state", async () => { await historyManager.addProject(["/save/state"]) await historyManager.saveState() - const historyManager2 = new HistoryManager({stateStore, localStorage: window.localStorage, project, commands: commandRegistry}) + const historyManager2 = new HistoryManager({stateStore, project, commands: commandRegistry}) await historyManager2.loadState() expect(historyManager2.getProjects()[0].paths).toEqual(['/save/state']) }) diff --git a/src/atom-environment.coffee b/src/atom-environment.coffee index 3f3f0fbdb..9117fe0ba 100644 --- a/src/atom-environment.coffee +++ b/src/atom-environment.coffee @@ -257,7 +257,6 @@ class AtomEnvironment extends Model @observeAutoHideMenuBar() - @history.initialize(@window.localStorage) @disposables.add @applicationDelegate.onDidChangeHistoryManager(=> @history.loadState()) preloadPackages: -> diff --git a/src/history-manager.js b/src/history-manager.js index cd151e660..a8ddbaae9 100644 --- a/src/history-manager.js +++ b/src/history-manager.js @@ -17,10 +17,6 @@ export class HistoryManager { this.disposables.add(project.onDidChangePaths((projectPaths) => this.addProject(projectPaths))) } - initialize (localStorage) { - this.localStorage = localStorage - } - destroy () { this.disposables.dispose() } @@ -98,10 +94,6 @@ export class HistoryManager { async loadState () { let history = await this.stateStore.load('history-manager') - if (!history) { - history = JSON.parse(this.localStorage.getItem('history')) - } - if (history && history.projects) { this.projects = history.projects.filter(p => Array.isArray(p.paths) && p.paths.length > 0).map(p => new HistoryProject(p.paths, new Date(p.lastOpened))) this.didChangeProjects({reloaded: true})