Skip to content

Commit

Permalink
Add debug, un-hide ping (#89)
Browse files Browse the repository at this point in the history
* Add typecheck against null

* Revert "Hide ping till fixed (#79)"

This reverts commit f907c7e.

* Update [id].tsx

* Update views.ts
  • Loading branch information
Yasamato authored Dec 30, 2023
1 parent e94c451 commit 21e0a5b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions components/data/OnlineStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const OnlineStatus: FC<Props> = ({ item }) => {
}

return (
<div style={{ display: 'none' }}>
<>
<span
className={style}
onClick={() => setShow(true)}
Expand All @@ -64,7 +64,7 @@ const OnlineStatus: FC<Props> = ({ item }) => {
close={() => setShow(false)}
/>
)}
</div>
</>
)
}

Expand Down
1 change: 1 addition & 0 deletions lib/db/views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export async function getLastViews(type: Types, n: number) {
.limit(n)
.toArray()
)
console.log('Found', data.length, 'entries in views table for', type)

// count what has been popular recently
let accumulated = {}
Expand Down
5 changes: 3 additions & 2 deletions pages/item/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { Column } from '../../types/Column'
import { Collection } from '../../types/Collection'
import DeleteButton from '../../components/buttons/DeleteButton'
import { faStar } from '@fortawesome/free-solid-svg-icons/faStar'
import { findOneTyped, getAllTyped } from '../../lib/db/dbTyped'

type Props = {
item: Item
Expand Down Expand Up @@ -359,7 +360,7 @@ const Item: FC<Props> = ({ item, columns, collections }) => {
export default Item

export async function getStaticPaths() {
const items = await getItems()
const items = await getAllTyped(Types.item)
const paths = items.map((i) => {
return {
params: {
Expand All @@ -375,7 +376,7 @@ export async function getStaticPaths() {
}

export async function getStaticProps({ params }) {
const item = await getItem(params.id)
const item = await findOneTyped(Types.item, params.id) as Item
if (!item) {
return {
notFound: true,
Expand Down

0 comments on commit 21e0a5b

Please sign in to comment.