-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(alert-v2): solve service store bug (#5659)
Signed-off-by: samuel.park <samuel.park@megazone.com>
- Loading branch information
1 parent
91d45d3
commit 8e5dc5c
Showing
7 changed files
with
13 additions
and
15 deletions.
There are no files selected for viewing
10 changes: 7 additions & 3 deletions
10
apps/web/src/lib/config/composables/use-is-alert-manager-v2-enabled.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
import type { ComputedRef } from 'vue'; | ||
import { computed } from 'vue'; | ||
|
||
import { useDomainStore } from '@/store/domain/domain-store'; | ||
import { pinia } from '@/store/pinia'; | ||
|
||
import config from '@/lib/config'; | ||
|
||
/* NOTE: | ||
* This hook will be removed or refactored once the global config is improved. | ||
* */ | ||
|
||
export const useIsAlertManagerV2Enabled = (): boolean => { | ||
const domainStore = useDomainStore(); | ||
export const useIsAlertManagerV2Enabled = (): ComputedRef<boolean> => { | ||
const domainStore = useDomainStore(pinia); | ||
const domainStoreState = domainStore.state; | ||
|
||
const enabledDomains = config.get('ADVANCED_SERVICE')?.alert_manager_v2 ?? []; | ||
|
||
return enabledDomains.includes(domainStoreState.domainId); | ||
return computed(() => enabledDomains.includes(domainStoreState.domainId)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters