mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-06 05:39:12 +00:00
Fix timestamp bug for pending message and expand CSP for thumbnails
This commit is contained in:
@@ -21,7 +21,7 @@ export default function RootLayout({
|
|||||||
script-src 'self' https://assets.khoj.dev 'unsafe-inline' 'unsafe-eval';
|
script-src 'self' https://assets.khoj.dev 'unsafe-inline' 'unsafe-eval';
|
||||||
connect-src 'self' https://ipapi.co/json ws://localhost:42110;
|
connect-src 'self' https://ipapi.co/json ws://localhost:42110;
|
||||||
style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com;
|
style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com;
|
||||||
img-src 'self' data: https://*.khoj.dev https://*.googleusercontent.com;
|
img-src 'self' data: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com;
|
||||||
font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com;
|
font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com;
|
||||||
child-src 'none';
|
child-src 'none';
|
||||||
object-src 'none';"></meta>
|
object-src 'none';"></meta>
|
||||||
|
|||||||
@@ -299,7 +299,7 @@ export default function ChatHistory(props: ChatHistoryProps) {
|
|||||||
message: props.pendingMessage,
|
message: props.pendingMessage,
|
||||||
context: [],
|
context: [],
|
||||||
onlineContext: {},
|
onlineContext: {},
|
||||||
created: new Date().toISOString(),
|
created: (new Date().getTime()).toString(),
|
||||||
by: "you",
|
by: "you",
|
||||||
automationId: '',
|
automationId: '',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -267,7 +267,12 @@ export default function ChatMessage(props: ChatMessageProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function renderTimeStamp(timestamp: string) {
|
function renderTimeStamp(timestamp: string) {
|
||||||
const messageDateTime = new Date(timestamp + 'Z');
|
|
||||||
|
console.log("INCOMING TIMESTAMP", timestamp);
|
||||||
|
if (!timestamp.endsWith('Z')) {
|
||||||
|
timestamp = timestamp + 'Z';
|
||||||
|
}
|
||||||
|
const messageDateTime = new Date(timestamp);
|
||||||
const currentDataTime = new Date();
|
const currentDataTime = new Date();
|
||||||
const timeDiff = currentDataTime.getTime() - messageDateTime.getTime();
|
const timeDiff = currentDataTime.getTime() - messageDateTime.getTime();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user