Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

about:history no longer includes bookmarks #3628

Merged
merged 1 commit into from
Aug 31, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions js/about/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ class HistoryDay extends ImmutableComponent {
<div className='sectionTitle historyDayName'>{this.props.date}</div>
<SortableTable headings={['time', 'title', 'domain']}
rows={this.props.entries.map((entry) => [
new Date(entry.get('lastAccessedTime')).toLocaleTimeString(),
entry.get('lastAccessedTime')
? new Date(entry.get('lastAccessedTime')).toLocaleTimeString()
: '',
entry.get('customTitle') || entry.get('title')
? entry.get('customTitle') || entry.get('title')
: entry.get('location'),
Expand All @@ -53,8 +55,10 @@ class HistoryDay extends ImmutableComponent {

class GroupedHistoryList extends ImmutableComponent {
getDayString (locale, item) {
return new Date(item.get('lastAccessedTime'))
.toLocaleDateString(locale, { weekday: 'long', month: 'long', day: 'numeric', year: 'numeric' })
const lastAccessedTime = item.get('lastAccessedTime')
return lastAccessedTime
? new Date(lastAccessedTime).toLocaleDateString(locale, { weekday: 'long', month: 'long', day: 'numeric', year: 'numeric' })
: ''
}
groupEntriesByDay (locale) {
const reduced = this.props.history.reduce((previousValue, currentValue, currentIndex, array) => {
Expand Down Expand Up @@ -159,15 +163,14 @@ class AboutHistory extends React.Component {

<div className='siteDetailsPageContent'>
{
this.state.search
? <GroupedHistoryList
<GroupedHistoryList
languageCodes={this.state.languageCodes}
settings={this.state.settings}
history={this.searchedSiteDetails(this.state.search, this.state.history)} />
: <GroupedHistoryList
languageCodes={this.state.languageCodes}
settings={this.state.settings}
history={this.historyDescendingOrder()} />
history={
this.state.search
? this.searchedSiteDetails(this.state.search, this.historyDescendingOrder())
: this.historyDescendingOrder()
} />
}
</div>
</div>
Expand Down