Skip to content

Commit

Permalink
Fix site sync issue (#51)
Browse files Browse the repository at this point in the history
Co-authored-by: Germey <[email protected]>
  • Loading branch information
Germey and Germey authored Jun 17, 2024
1 parent 8fca429 commit 4a0bd88
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix the site sync bug",
"packageName": "@acedatacloud/nexior",
"email": "[email protected]",
"dependentChangeType": "patch"
}
4 changes: 3 additions & 1 deletion src/utils/initializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
}
};

0 comments on commit 4a0bd88

Please sign in to comment.