diff --git a/src/nodeTypesStore.js b/src/nodeTypesStore.js index 6cd48ec1c..507353e06 100644 --- a/src/nodeTypesStore.js +++ b/src/nodeTypesStore.js @@ -114,7 +114,7 @@ export default new Vuex.Store({ }, actions: { getUserPinnedObjects({ commit }) { - if (!window.ProcessMaker.user) { + if (window.ProcessMaker?.user?.id === 'standalone') { // For standalone version of Modeler const pinnedNodes = localStorage.pinnedNodes ? JSON.parse(localStorage.pinnedNodes) : [] ; pinnedNodes.forEach(node => { @@ -137,7 +137,7 @@ export default new Vuex.Store({ addUserPinnedObject({ commit, state }, pinnedNode) { commit('setPinnedNodes', pinnedNode); const pinnedNodes = state.pinnedNodeTypes; - if (!window.ProcessMaker.user) { + if (window.ProcessMaker?.user?.id === 'standalone') { // For standalone version of Modeler localStorage.pinnedNodes = JSON.stringify(pinnedNodes); return; @@ -152,7 +152,7 @@ export default new Vuex.Store({ removeUserPinnedObject({ commit, state }, nodeToUnpin) { commit('setUnpinNode', nodeToUnpin); const pinnedNodes = state.pinnedNodeTypes; - if (!window.ProcessMaker.user) { + if (window.ProcessMaker?.user?.id === 'standalone') { // For standalone version of Modeler localStorage.pinnedNodes = JSON.stringify(pinnedNodes); return; diff --git a/src/setup/globals.js b/src/setup/globals.js index 0dbba85b5..ecb9b8d41 100644 --- a/src/setup/globals.js +++ b/src/setup/globals.js @@ -4,6 +4,7 @@ import MockAdapter from 'axios-mock-adapter'; import mockProcesses from './mockProcesses.json'; import mockSignals from './mockSignals.json'; import mockProcessSvg from './mockProcessSvg'; +import { faker } from '@faker-js/faker'; axios.defaults.baseURL = 'https://bpm4.local.processmaker.com/api/1.0/'; axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; @@ -57,5 +58,10 @@ window.ProcessMaker = { id: 1, }, }, + user: { + id: 'standalone', + fullName: faker.person.fullName(), + avatar: null, + }, };