Skip to content

Commit

Permalink
Fix type errors and add version call
Browse files Browse the repository at this point in the history
  • Loading branch information
IanPhilips committed Sep 19, 2024
1 parent c5541a4 commit 923407c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
if: ${{ success() || failure() }}
working-directory: backend/shared
run: yarn build
- name: Check TypeScript Version
run: tsc --version
- name: Run Typescript checker on API
working-directory: backend/api
run: tsc --noEmit --skipLibCheck --pretty
Expand Down
10 changes: 5 additions & 5 deletions common/src/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ export type PrivateUser = {

// TODO: remove. Hardcoding the strings would be better.
// Different views require different language.
export const BETTOR = ENV_CONFIG.bettor ?? 'trader'
export const BETTORS = ENV_CONFIG.bettor + 's' ?? 'traders'
export const SINGULAR_BET = ENV_CONFIG.nounBet ?? 'trade' // prediction (noun)
export const PLURAL_BETS = ENV_CONFIG.nounBet + 's' ?? 'trades' // predictions (noun)
export const BETTOR = ENV_CONFIG.bettor
export const BETTORS = ENV_CONFIG.bettor + 's'
export const SINGULAR_BET = ENV_CONFIG.nounBet // prediction (noun)
export const PLURAL_BETS = ENV_CONFIG.nounBet + 's' // predictions (noun)
// export const PRESENT_BET = ENV_CONFIG.presentBet ?? 'trade' // predict (verb)
export const PAST_BET = ENV_CONFIG.verbPastBet ?? 'traded' // predicted (verb)
export const PAST_BET = ENV_CONFIG.verbPastBet // predicted (verb)

export type UserAndPrivateUser = { user: User; privateUser: PrivateUser }
export const MANIFOLD_USER_USERNAME = 'Manifold'
Expand Down
2 changes: 1 addition & 1 deletion web/components/activity-log.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export function ActivityLog(props: {
!blockedContractIds.includes(c.id) &&
!blockedUserIds.includes(c.creatorId) &&
c.visibility === 'public' &&
(!c.groupSlugs?.some((slug) => blockedGroupSlugs.includes(slug)) ??
(!c.groupSlugs?.some((slug) => blockedGroupSlugs.includes(slug)) ||
true) &&
(topicSlugs?.some((s) => c.groupSlugs?.includes(s)) ?? true)
)
Expand Down
2 changes: 1 addition & 1 deletion web/components/contract/contract-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function CloseDate(props: {
dayjs.duration(900, 'year')
)
const neverCloses =
!closeTime ??
!closeTime ||
(NO_CLOSE_TIME_TYPES.includes(contract.outcomeType) &&
dayjs(closeTime).isAfter(almostForeverTime))

Expand Down
2 changes: 1 addition & 1 deletion web/components/contract/upgrade-tier-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function UpgradeTierButton(props: {
if (disabled) return <></>

const alreadyHighestTier =
contract.marketTier === 'crystal' ??
contract.marketTier === 'crystal' ||
getTierFromLiquidity(contract, contract.totalLiquidity) === 'crystal'

return (
Expand Down
3 changes: 2 additions & 1 deletion web/hooks/use-defined-search-params.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { useSearchParams } from 'next/navigation'
import { useCallback } from 'react'
import { URLSearchParams } from 'url'
export const useDefinedSearchParams = () => {
// Note: useSearchParams() must be used inside a <Suspense> component if page is SSR
const searchParams = useSearchParams()!
const createQueryString = useCallback(
(name: string, value: string) => {
const params = new URLSearchParams(searchParams)
const params = new URLSearchParams(searchParams as URLSearchParams)
params.set(name, value)

return params.toString()
Expand Down

0 comments on commit 923407c

Please sign in to comment.