Skip to content

Always getting a parent tab id and new tab is undefined #1

Description

@tannerolsen7

In testing this using Vue 3 composition api, I am always getting an undefined new tab and the parent id is always there. Any thoughts as to why?

`<script setup lang="ts">
import { onMounted, ref } from 'vue';
import { RouterView } from 'vue-router';
import UniqueTabId from "unique-tabid";

const uniqueTabId = new UniqueTabId("portal");
uniqueTabId.WAIT_TIMEOUT = 2000;
uniqueTabId.uniqIdFunc = generateSessionId;

onMounted(() => {
  uniqueTabId.initTab()
})

function generateSessionId() {
  const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
  const length = 12;
  let randomStr = '';
  for (let i = 0; i < length; i++) {
      randomStr += characters.charAt(Math.floor(Math.random() * characters.length));
  }
  return `${ randomStr }`;
}

let text = ref('')
uniqueTabId.tabIdCallback = ({ tabId, isNewTab, parentTabId }) => text.value = `TabId: ${tabId}; New Tab: ${isNewTab}; Duplicated: ${parentTabId !== null ? `Yes. ParentTabId = ${parentTabId}` : "No"}`;
</script>

{{ text }}

<style scoped> </style>

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions