Fix site sync issue (#51)
This commit is contained in:
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"
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ import { getCookie, setCookie } from 'typescript-cookie';
|
|||||||
import favicon from '@/assets/images/favicon.ico';
|
import favicon from '@/assets/images/favicon.ico';
|
||||||
import { getLocale } from '@/i18n';
|
import { getLocale } from '@/i18n';
|
||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
|
import { log } from './log';
|
||||||
|
|
||||||
export const getDomain = () => {
|
export const getDomain = () => {
|
||||||
const host = window.location.hostname;
|
const host = window.location.hostname;
|
||||||
@@ -133,8 +134,9 @@ export const initializeSite = async () => {
|
|||||||
await store.dispatch('getSite');
|
await store.dispatch('getSite');
|
||||||
// after getSite, the site should have been set
|
// after getSite, the site should have been set
|
||||||
const site = store.state.site;
|
const site = store.state.site;
|
||||||
|
log(initializeSite, 'site', site);
|
||||||
// if site is not set, try to initialize site
|
// if site is not set, try to initialize site
|
||||||
if (!site) {
|
if (!site?.origin) {
|
||||||
await store.dispatch('initializeSite');
|
await store.dispatch('initializeSite');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user