Skip to content

Commit

Permalink
chore: add skip ngm check option (#1144)
Browse files Browse the repository at this point in the history
  • Loading branch information
shhdgit authored Jan 17, 2022
1 parent ac4ddec commit 5fb4cd3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ui/dashboardApp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async function webPageStart() {
applySentryTracingInterceptor(instance)
}

if (info?.ngm_state === NgmState.NotStarted) {
if (!options.skipNgmCheck && info?.ngm_state === NgmState.NotStarted) {
notification.error({
key: 'ngm_not_started',
message: i18next.t('health_check.failed_notification_title'),
Expand Down Expand Up @@ -167,14 +167,15 @@ async function main() {
if (routing.isPortalPage()) {
// the portal page is only used to receive options
function handlePortalEvent(event) {
const { type, token, lang, hideNav, redirectPath } = event.data
const { type, token, lang, hideNav, skipNgmCheck, redirectPath } =
event.data
// the event type must be "DASHBOARD_PORTAL_EVENT"
if (type !== 'DASHBOARD_PORTAL_EVENT') {
return
}

auth.setAuthToken(token)
saveAppOptions({ hideNav, lang })
saveAppOptions({ hideNav, lang, skipNgmCheck })
window.location.hash = `#${redirectPath}`
window.location.reload()

Expand Down
2 changes: 2 additions & 0 deletions ui/lib/utils/appOptions.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
export type AppOptions = {
hideNav: boolean
skipNgmCheck: boolean
lang: string
}

const defAppOptions: AppOptions = {
hideNav: false,
skipNgmCheck: false,
lang: '',
}

Expand Down

0 comments on commit 5fb4cd3

Please sign in to comment.