style: Prettier format

This commit is contained in:
April Hall 2025-01-11 15:10:16 -05:00
parent 016813dd56
commit ac93c0ca4b
Signed by: arithefirst
GPG Key ID: 4508A15C4DB91C5B
3 changed files with 6 additions and 3 deletions

View File

@ -34,7 +34,6 @@ async function getMessages(client: cassandra.Client, channelName: string, limit:
// to be specified by EQ or IN when using ORDER BY // to be specified by EQ or IN when using ORDER BY
res.rows.sort((a, b) => a.timestamp - b.timestamp); res.rows.sort((a, b) => a.timestamp - b.timestamp);
// For the same reason as above, we have to apply the limit manually // For the same reason as above, we have to apply the limit manually
// as well, because if we only query 5, but they're not properly sorted, // as well, because if we only query 5, but they're not properly sorted,
// it will only return the first 5 instead of the last 5 // it will only return the first 5 instead of the last 5

View File

@ -6,7 +6,11 @@ export const load: PageLoad = async () => {
const rows = await getMessages(client, '000', 5); const rows = await getMessages(client, '000', 5);
const messages: TypeMessage[] = rows const messages: TypeMessage[] = rows
? rows.map((value) => { ? rows.map((value) => {
return { message: value.message_content, user: value.sender.toString(), imageSrc: `https://api.dicebear.com/9.x/identicon/svg?seed=${value.sender.toString()}` }; return {
message: value.message_content,
user: value.sender.toString(),
imageSrc: `https://api.dicebear.com/9.x/identicon/svg?seed=${value.sender.toString()}`,
};
}) })
: []; : [];
return { return {

View File

@ -56,6 +56,6 @@
</div> </div>
<form class="flex mb-2 mx-2 mt-1" onsubmit={sendMessage}> <form class="flex mb-2 mx-2 mt-1" onsubmit={sendMessage}>
<input type="text" placeholder="Type here" class="input border-base-300 w-5/6 mr-1 border-2" bind:value={msg} /> <input type="text" placeholder="Type here" class="input border-base-300 w-5/6 mr-1 border-2" bind:value={msg} />
<button aria-label="send message" class="btn w-1/6 btn-primary" type="submit"><SendIcon/></button> <button aria-label="send message" class="btn w-1/6 btn-primary" type="submit"><SendIcon /></button>
</form> </form>
</main> </main>