Skip to content

Commit

Permalink
Added better feedback for when newly created db is online (#1830)
Browse files Browse the repository at this point in the history
* Added better feedback for when newly created db is online

and disable the selection while it is starting up.

* Fixed so correct code in DatabaseUnavailableError
  • Loading branch information
eijawerner authored Sep 29, 2022
1 parent 558f110 commit f434242
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/browser/modules/DBMSInfo/DatabaseSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const Select = styled.select`
const EMPTY_OPTION = 'Select db to use'

const HOUSE_EMOJI = '\u{1F3E0}'
const HOUR_GLASS_EMOJI = '\u{231B}'
const NBSP_CHAR = '\u{00A0}'

type DatabaseSelectorProps = {
Expand Down Expand Up @@ -82,9 +83,14 @@ export const DatabaseSelector = ({
>
{uniqDatabases.map(db => {
return (
<option key={db.name} value={db.name}>
<option
key={db.name}
value={db.name}
disabled={db.status === 'unknown'}
>
{db.name}
{db === homeDb ? NBSP_CHAR + HOUSE_EMOJI : ''}
{db.status === 'unknown' ? NBSP_CHAR + HOUR_GLASS_EMOJI : ''}
</option>
)
})}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/services/exceptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export function DatabaseUnavailableError({
dbName: string
dbMeta: { status: string }
}): BrowserError {
const type = 'DatabaseNotFoundError'
const type = 'DatabaseUnavailableError'
return {
type,
code: type,
Expand Down

0 comments on commit f434242

Please sign in to comment.