Skip to content

Commit

Permalink
fix(sync-mode): showing undefined when sync status is not-deployed (#…
Browse files Browse the repository at this point in the history
…5522)

* fix: showing undefined when sync status is not-deployed

* chore: updated to handle all sync states
  • Loading branch information
mkhq authored Dec 6, 2023
1 parent eef3759 commit 9f96768
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions core/src/commands/sync/sync-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ function stateStyle(state: SyncState, msg: string) {
return styleFn(msg)
}

const verbMap: { [key in SyncState]: string } = {
"active": "is",
"failed": "has",
"not-active": "is",
"not-deployed": "is",
"unknown": "is",
"not-configured": "is",
"outdated": "is",
}

function describeState(state: SyncState) {
return state.replace("-", " ")
}
Expand Down Expand Up @@ -188,12 +198,6 @@ export async function getSyncStatuses({
})
syncStatus["syncs"] = sorted

const verbMap = {
"active": "is",
"failed": "has",
"not-active": "is",
}

const syncCount = syncStatus.syncs.length
const pluralizedSyncs = syncCount === 1 ? "sync" : "syncs"
log.info(
Expand Down

0 comments on commit 9f96768

Please sign in to comment.