Skip to content

Commit

Permalink
ui/components: Convert NewUserSetUp to ts (#3242)
Browse files Browse the repository at this point in the history
* convert NewUserSetUp to ts

* updated userId type to string

* changed to single  quotation
  • Loading branch information
leyasalazar authored Aug 31, 2023
1 parent 498dbff commit c7d8bdf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import UserContactMethodVerificationDialog from '../../users/UserContactMethodVe
import { useSessionInfo } from '../../util/RequireConfig'
import { useResetURLParams, useURLParam } from '../../actions'

export default function NewUserSetup() {
export default function NewUserSetup(): JSX.Element {
const [isFirstLogin] = useURLParam('isFirstLogin', '')
const clearIsFirstLogin = useResetURLParams('isFirstLogin')
const [contactMethodID, setContactMethodID] = useState('')
const { userID, ready } = useSessionInfo()

if (!isFirstLogin || !ready) {
return null
return <React.Fragment />
}
if (contactMethodID) {
return (
Expand Down
4 changes: 2 additions & 2 deletions web/src/app/util/RequireConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const ConfigContext = React.createContext({
integrationKeyTypes: [] as IntegrationKeyTypeInfo[],
config: [] as ConfigValue[],
isAdmin: false as boolean,
userID: null as string | null,
userID: '' as string,
userName: null as string | null,
})
ConfigContext.displayName = 'ConfigContext'
Expand Down Expand Up @@ -94,7 +94,7 @@ const mapConfig = (value: ConfigValue[]): ConfigData => {

export type SessionInfo = {
isAdmin: boolean
userID: string | null
userID: string
userName: string | null
ready: boolean
}
Expand Down

0 comments on commit c7d8bdf

Please sign in to comment.