Eliminate reliance on local storage in HistoryManager

It's causing test failures locally and enough time has passed that most
user data should be transitioned to indexed DB by now.
This commit is contained in:
Nathan Sobo
2017-05-11 16:58:48 -06:00
parent f8ecf929a8
commit d584bd6adb
3 changed files with 2 additions and 12 deletions

View File

@@ -257,7 +257,6 @@ class AtomEnvironment extends Model
@observeAutoHideMenuBar()
@history.initialize(@window.localStorage)
@disposables.add @applicationDelegate.onDidChangeHistoryManager(=> @history.loadState())
preloadPackages: ->

View File

@@ -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})