Przeglądaj źródła

feat: tabs in create do sort actions

nian 2 miesięcy temu
rodzic
commit
8406e04ad4
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      src/stores/tabs.ts

+ 4 - 0
src/stores/tabs.ts

@@ -38,6 +38,10 @@ export const useTabsStore = defineStore('tabsStore', () => {
     if (!tabs.value.some(({ path }) => path === tab.path)) {
       const id = Date.now()
       tabs.value.push({ ...tab, id })
+
+      if (tab.pinned) {
+        sortTabs()
+      }
     }
 
     setTabActivePath(tab.path)