<template>
  <div>
    <span class="mr-auto">Reload</span>
  </div>
</template>

<script>
export default {
  inject: ["Reload"],

  watch: {
    "Reload.reloadFlag": {
      handler(yes) {
        setTimeout(
          function () {
            this.Reload.reloadFlag = false;
          }.bind(this),
          1000
        );
        if (yes) this.reload();
      },
    },
  },

  methods: {
    reload() {
      this.$emit("c:reload:reload");
      location.reload(!0);
    },
  },
};
</script>
