Skip to content

Commit

Permalink
fixes images (mckaywrigley#1234)
Browse files Browse the repository at this point in the history
  • Loading branch information
mckaywrigley authored Jan 22, 2024
1 parent 62e8b0b commit 7e2ad98
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
10 changes: 5 additions & 5 deletions app/[locale]/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { createServerClient } from "@supabase/ssr"
import { Metadata } from "next"
import { cookies, headers } from "next/headers"
import { redirect } from "next/navigation"
import { get } from '@vercel/edge-config';
import { get } from "@vercel/edge-config"

export const metadata: Metadata = {
title: "Login"
Expand Down Expand Up @@ -64,10 +64,10 @@ export default async function Login({
const password = formData.get("password") as string

if (process.env.EMAIL_DOMAIN_WHITELIST || process.env.EDGE_CONFIG) {
let patternsString = process.env.EMAIL_DOMAIN_WHITELIST;
let patternsString = process.env.EMAIL_DOMAIN_WHITELIST

if (process.env.EDGE_CONFIG)
patternsString = await get<string>('EMAIL_DOMAIN_WHITELIST');
patternsString = await get<string>("EMAIL_DOMAIN_WHITELIST")

const emailDomainWhitelist = patternsString?.split(",") ?? []

Expand All @@ -82,10 +82,10 @@ export default async function Login({
}

if (process.env.EMAIL_WHITELIST || process.env.EDGE_CONFIG) {
let patternsString = process.env.EMAIL_WHITELIST;
let patternsString = process.env.EMAIL_WHITELIST

if (process.env.EDGE_CONFIG)
patternsString = await get<string>('EMAIL_WHITELIST');
patternsString = await get<string>("EMAIL_WHITELIST")

const emailWhitelist = patternsString?.split(",") ?? []

Expand Down
5 changes: 3 additions & 2 deletions components/chat/chat-helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,10 @@ export const handleCreateMessages = async (

setChatImages(prevImages => [
...prevImages,
...newMessageImages.map(obj => ({
...newMessageImages.map((obj, index) => ({
...obj,
messageId: createdMessages[0].id
messageId: createdMessages[0].id,
path: paths[index]
}))
])

Expand Down
4 changes: 1 addition & 3 deletions components/messages/message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,7 @@ export const Message: FC<MessageProps> = ({

<div className="mt-3 flex flex-wrap gap-2">
{message.image_paths.map((path, index) => {
const item = chatImages.find(
image => image.messageId === message.id
)
const item = chatImages.find(image => image.path === path)

return (
<Image
Expand Down

0 comments on commit 7e2ad98

Please sign in to comment.