Skip to content

Commit

Permalink
Merge pull request #524 from systemli/Remove-active-field-from-Ticker
Browse files Browse the repository at this point in the history
🔥 Remove active field from Ticker
  • Loading branch information
0x46616c6b authored Oct 20, 2023
2 parents 748ad81 + 901af45 commit f6c30bb
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/Ticker.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ describe('Ticker', function () {
} as Settings
const ticker = {
id: '1',
active: true,
createdAt: new Date(),
title: 'Ticker Title',
description: 'Ticker Description',
Expand Down
6 changes: 1 addition & 5 deletions src/Ticker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,11 @@ const Ticker: FC = () => {
return <ErrorView message="It seems that you are offline." />
}

if (ticker?.active) {
return <ActiveView />
}

if (ticker === null && settings?.inactiveSettings !== undefined) {
return <InactiveView settings={settings.inactiveSettings} />
}

return <div>...</div>
return <ActiveView />
}

export default Ticker
5 changes: 1 addition & 4 deletions src/components/useTicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ export function TickerProvider({ children }: { children: ReactNode }): JSX.Eleme
setSettings(response.data.settings)
}

if (response.data.ticker?.active) {
setTicker(response.data.ticker)
}

setTicker(response.data.ticker)
setIsLoading(false)
})
.catch(error => {
Expand Down
1 change: 0 additions & 1 deletion src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export type Ticker = {
active: boolean
createdAt: Date
description: string
domain: string
Expand Down

0 comments on commit f6c30bb

Please sign in to comment.