Fix site sync issue (#51)

This commit is contained in:
AceDataCloud committed 2024-06-17 14:38:38 +00:00
1 parent f21eb5f6ab
commit 653774d82f
2 files changed
+10 -1

No files matched your search

@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix the site sync bug",
"packageName": "@acedatacloud/nexior",
"email": "germey@acedata.cloud",
"dependentChangeType": "patch"
}
+3 -1
View File
@@ -2,6 +2,7 @@ import { getCookie, setCookie } from 'typescript-cookie';
import favicon from '@/assets/images/favicon.ico';
import { getLocale } from '@/i18n';
import store from '@/store';
import { log } from './log';
export const getDomain = () => {
const host = window.location.hostname;
@@ -133,8 +134,9 @@ export const initializeSite = async () => {
await store.dispatch('getSite');
// after getSite, the site should have been set
const site = store.state.site;
log(initializeSite, 'site', site);
// if site is not set, try to initialize site
if (!site) {
if (!site?.origin) {
await store.dispatch('initializeSite');
}
};