2021-09-29 00:36:41 +02:00
|
|
|
export default function (context) {
|
|
|
|
if (process.client) {
|
|
|
|
var route = context.route
|
|
|
|
var from = context.from
|
|
|
|
var store = context.store
|
|
|
|
|
|
|
|
if (route.name === 'login' || from.name === 'login') return
|
|
|
|
|
2021-10-01 01:52:32 +02:00
|
|
|
if (!route.name) {
|
|
|
|
console.warn('No Route name', route)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
if (route.name.startsWith('config') || route.name === 'upload' || route.name === 'account' || route.name.startsWith('audiobook-id')) {
|
2021-10-23 03:08:02 +02:00
|
|
|
if (from.name !== route.name && from.name !== 'audiobook-id-edit' && !from.name.startsWith('config') && from.name !== 'upload' && from.name !== 'account') {
|
2021-09-29 00:36:41 +02:00
|
|
|
var _history = [...store.state.routeHistory]
|
|
|
|
if (!_history.length || _history[_history.length - 1] !== from.fullPath) {
|
|
|
|
_history.push(from.fullPath)
|
|
|
|
store.commit('setRouteHistory', _history)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|