diff --git a/app/client/web/src/content/Content.tsx b/app/client/web/src/content/Content.tsx index 0be0aff0..0e60a6ed 100644 --- a/app/client/web/src/content/Content.tsx +++ b/app/client/web/src/content/Content.tsx @@ -14,7 +14,7 @@ export function Content({ select }: { select: (focus: Focus) => void }) { const [adding, setAdding] = useState(false) const [sealed, setSealed] = useState(false) const [subject, setSubject] = useState('') - const [added, setAdded] = useState([]) + const [added, setAdded] = useState([] as string[]) const cards = state.sealSet && sealed ? state.sealable : state.connected const addTopic = async () => { diff --git a/app/client/web/src/content/useContent.hook.ts b/app/client/web/src/content/useContent.hook.ts index 6222f59a..0aa88bcd 100644 --- a/app/client/web/src/content/useContent.hook.ts +++ b/app/client/web/src/content/useContent.hook.ts @@ -24,8 +24,9 @@ export function useContent() { strings: display.state.strings, layout: null, guid: '', + cards: [] as Card[], connected: [] as Card[], - sealable: [] as Cards[], + sealable: [] as Card[], sorted: [] as Channel[], filtered: [] as ChannelParams[], filter: '', @@ -37,9 +38,9 @@ export function useContent() { const aval = `${a.handle}/${a.node}` const bval = `${b.handle}/${b.node}` if (aval < bval) { - return state.sortAsc ? 1 : -1 + return 1; } else if (aval > bval) { - return state.sortAsc ? -1 : 1 + return -1; } return 0 } @@ -168,8 +169,8 @@ export function useContent() { } const setCards = (cards: Card[]) => { const sorted = cards.sort(compare) - const connected = [] - const sealable = [] + const connected = [] as Card[] + const sealable = [] as Card[] sorted.forEach((card) => { if (card.status === 'connected') { connected.push(card)