Skip to content

Commit

Permalink
chore(#150): update recent store
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher committed Aug 24, 2021
1 parent d82c0ac commit 7372621
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
3 changes: 0 additions & 3 deletions docs/middleware/recent.js

This file was deleted.

4 changes: 0 additions & 4 deletions docs/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,4 @@ export default {
build: {},

telemetry: true,

router: {
middleware: 'recent',
}
}
7 changes: 4 additions & 3 deletions docs/store/mutations.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
export default {
// TODO: add ability to pin items
// TODO: add support for page titles
addRecent(state, route) {
addRecent(state, link) {
// Filter out current route.
const recent = [...state.recent].filter((o) => o.to !== route.path)
const recent = [...state.recent].filter((o) => o.to !== link.to)

// Add item.
recent.unshift({
to: route.path
text: link.text,
to: link.to,
})

// Return only the last 5 items.
Expand Down

0 comments on commit 7372621

Please sign in to comment.