mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
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:
@@ -257,7 +257,6 @@ class AtomEnvironment extends Model
|
||||
|
||||
@observeAutoHideMenuBar()
|
||||
|
||||
@history.initialize(@window.localStorage)
|
||||
@disposables.add @applicationDelegate.onDidChangeHistoryManager(=> @history.loadState())
|
||||
|
||||
preloadPackages: ->
|
||||
|
||||
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user