mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-14 13:25:21 +00:00
simplify
This commit is contained in:
parent
969305fe89
commit
4a65d77dcf
1 changed files with 2 additions and 5 deletions
|
|
@ -7,7 +7,7 @@ import { getOrgFromDomain } from './data/org';
|
||||||
import { SINGLE_TENANT_ORG_DOMAIN, SINGLE_TENANT_ORG_ID, SOURCEBOT_GUEST_USER_ID } from './lib/constants';
|
import { SINGLE_TENANT_ORG_DOMAIN, SINGLE_TENANT_ORG_ID, SOURCEBOT_GUEST_USER_ID } from './lib/constants';
|
||||||
import { ServiceErrorException } from './lib/serviceError';
|
import { ServiceErrorException } from './lib/serviceError';
|
||||||
import { getOrgMetadata, isServiceError } from './lib/utils';
|
import { getOrgMetadata, isServiceError } from './lib/utils';
|
||||||
import { clearSearchContexts, getSearchContexts } from './actions';
|
import { clearSearchContexts } from './actions';
|
||||||
|
|
||||||
const logger = createLogger('web-initialize');
|
const logger = createLogger('web-initialize');
|
||||||
|
|
||||||
|
|
@ -67,10 +67,7 @@ const initSingleTenancy = async () => {
|
||||||
// search contexts that may be present in the DB
|
// search contexts that may be present in the DB
|
||||||
const hasSearchContextEntitlement = hasEntitlement("search-contexts")
|
const hasSearchContextEntitlement = hasEntitlement("search-contexts")
|
||||||
if(!hasSearchContextEntitlement) {
|
if(!hasSearchContextEntitlement) {
|
||||||
const searchContexts = await getSearchContexts(SINGLE_TENANT_ORG_DOMAIN);
|
clearSearchContexts(SINGLE_TENANT_ORG_DOMAIN)
|
||||||
if (!isServiceError(searchContexts) && searchContexts.length > 0) {
|
|
||||||
clearSearchContexts(SINGLE_TENANT_ORG_DOMAIN)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sync anonymous access config from the config file
|
// Sync anonymous access config from the config file
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue