<template>
  <mx-paper :options="options" class="pl20 pr20 pt20 pb40"></mx-paper>
</template>

<script>
import MxPaper from '@/components/MxPaper/mx-paper'
import transferMixin from '@/components/mx-transfer-mixin'
import paperMixin from '@/components/MxPaper/mx-paper-mixin'
import EventBus from '@/components/EventBus'

export default {
  mixins: [transferMixin, paperMixin],
  components: { MxPaper },
  data() {
    return {
      overrideOpts: {
        customScoredAction: true,
        customCommittedAction: true
      }
    }
  },
  mounted() {
    EventBus.instance.$on('customScoredAction', () => this.innerLoadPaper())
    EventBus.instance.$on('customCommittedAction', () => this.innerLoadPaper())
    this.loadPaper(this.prevData, this.overrideOpts)
  },
  beforeDestroy() {
    EventBus.instance.$off('customScoredAction')
    EventBus.instance.$off('customCommittedAction')
  },
  methods: {
    innerLoadPaper() {
      this.loadPaper({
        ...this.prevData,
        force: false
      }, this.overrideOpts)
    }
  }
}
</script>

<style scoped>

</style>
