fix: avoid crashing browser processes during tests
This commit is contained in:
parent
dbccdb239a
commit
7b05ed9d3d
@ -1,4 +1,4 @@
|
|||||||
import {watch, reactive, shallowReactive, unref, readonly, ref, computed, watchEffect} from 'vue'
|
import {watch, reactive, shallowReactive, unref, readonly, ref, computed} from 'vue'
|
||||||
import {acceptHMRUpdate, defineStore} from 'pinia'
|
import {acceptHMRUpdate, defineStore} from 'pinia'
|
||||||
import {useI18n} from 'vue-i18n'
|
import {useI18n} from 'vue-i18n'
|
||||||
import {useRouter} from 'vue-router'
|
import {useRouter} from 'vue-router'
|
||||||
@ -44,8 +44,6 @@ export const useProjectStore = defineStore('project', () => {
|
|||||||
return (id: IProject['id']) => projectsArray.value.filter(p => p.parentProjectId === id)
|
return (id: IProject['id']) => projectsArray.value.filter(p => p.parentProjectId === id)
|
||||||
})
|
})
|
||||||
|
|
||||||
watchEffect(() => baseStore.setCurrentProject(projects.value[baseStore.currentProject?.id] || null))
|
|
||||||
|
|
||||||
const findProjectByExactname = computed(() => {
|
const findProjectByExactname = computed(() => {
|
||||||
return (name: string) => {
|
return (name: string) => {
|
||||||
const project = Object.values(projects.value).find(l => {
|
const project = Object.values(projects.value).find(l => {
|
||||||
@ -72,6 +70,12 @@ export const useProjectStore = defineStore('project', () => {
|
|||||||
function setProject(project: IProject) {
|
function setProject(project: IProject) {
|
||||||
projects.value[project.id] = project
|
projects.value[project.id] = project
|
||||||
update(project)
|
update(project)
|
||||||
|
|
||||||
|
// FIXME: This should be a watcher, but using a watcher instead will sometimes crash browser processes.
|
||||||
|
// Reverted from 31b7c1f217532bf388ba95a03f469508bee46f6a
|
||||||
|
if (baseStore.currentProject?.id === project.id) {
|
||||||
|
baseStore.setCurrentProject(project)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setProjects(newProjects: IProject[]) {
|
function setProjects(newProjects: IProject[]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user