Skip to content

Commit

Permalink
Merge pull request #27 from tnfAngel-Chat:dev
Browse files Browse the repository at this point in the history
fix message cache
  • Loading branch information
tnfAngel authored May 10, 2024
2 parents 326cb47 + 5ff69c0 commit a9f5d23
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function RootLayout({
}}
>
<AppWrapper>
<Flex h='100%' w='100%' direction='column'>
<Flex h='100%' w='100%' direction='column' gap='0px'>
<ConnectionStatus />
<Box w='100%' h='100%' zIndex={1}>
{children}
Expand Down
5 changes: 3 additions & 2 deletions src/components/channel/InputArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ export default function InputArea({ channel }: Readonly<InputBoxProps>) {
})
);

//client.sentMessagesIds.push(tempMessageId);
if (client.links.api) {
client.sentMessagesIds.push(tempMessageId);

if (client.links.api)
await ky
.post(`${client.links.api}/channels/${channel?.id}/messages`, {
json: { content: content, nonce: tempMessageId }
Expand Down Expand Up @@ -163,6 +163,7 @@ export default function InputArea({ channel }: Readonly<InputBoxProps>) {
})
);
});
}
}
}

Expand Down
19 changes: 14 additions & 5 deletions src/components/general/ConnectionStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,24 @@ export default function ConnectionStatus() {
<Center
as={motion.div}
w='100%'
bg={getColorValue('ternaryBackground')}
initial={{ height: '0px' }}
animate={{ height: '32px', transition: { delay: 2 } }}
exit={{ height: '0px' }}
p='0px'
>
<Flex alignItems='center' gap='10px' zIndex={0}>
{statusSignals[statusIndex]}
<Text fontWeight='bold'>Connecting...</Text>
</Flex>
<Center
w='100%'
h='32px'
top='0%'
left='0%'
bg={getColorValue('ternaryBackground')}
position='fixed'
>
<Flex alignItems='center' gap='10px' zIndex={0}>
{statusSignals[statusIndex]}
<Text fontWeight='bold'>Connecting...</Text>
</Flex>
</Center>
</Center>
)}
</AnimatePresence>
Expand Down

0 comments on commit a9f5d23

Please sign in to comment.