import Vue from 'vue'
import router from '../router'
import Navigation from './vue-navigation.esm.js'
import { PostUserBehavior } from '../api'
import { Reader } from '../view/namespace.js'

Vue.use(Navigation, {router})

Vue.navigation.on('back',(to,from)=>{
  if(from.route.name === Reader.name){
    PostUserBehavior({
      uid: window.options.uid,
      current_url: from.route.fullPath
    })
  }
})