fix: address project review bugs
This commit is contained in:
@@ -12,7 +12,7 @@ import type { WebGenerationPreviewTask } from "../types";
|
||||
export interface ImageGenInput {
|
||||
projectId?: string;
|
||||
conversationId?: number;
|
||||
model: string;
|
||||
model?: string;
|
||||
prompt: string;
|
||||
ratio?: string;
|
||||
quality?: string;
|
||||
@@ -210,18 +210,18 @@ function getStoredSessionRole(): string {
|
||||
}
|
||||
|
||||
function emitImageRouteDebug(label: string, payload: Record<string, unknown>): void {
|
||||
// Only emit console logs for admin users — hides enterprise routing details
|
||||
if (getStoredSessionRole() === "admin") {
|
||||
const entry: ImageRouteDebugEntry = {
|
||||
at: new Date().toISOString(),
|
||||
label,
|
||||
...payload,
|
||||
};
|
||||
try {
|
||||
console.log(`${label} ${JSON.stringify(entry)}`);
|
||||
} catch {
|
||||
console.log(label, entry);
|
||||
}
|
||||
// Only emit route debug for admin users; provider routing is operational data.
|
||||
if (getStoredSessionRole() !== "admin") return;
|
||||
|
||||
const entry: ImageRouteDebugEntry = {
|
||||
at: new Date().toISOString(),
|
||||
label,
|
||||
...payload,
|
||||
};
|
||||
try {
|
||||
console.log(`${label} ${JSON.stringify(entry)}`);
|
||||
} catch {
|
||||
console.log(label, entry);
|
||||
}
|
||||
|
||||
if (typeof window === "undefined") return;
|
||||
@@ -229,7 +229,6 @@ function emitImageRouteDebug(label: string, payload: Record<string, unknown>): v
|
||||
const previousEntries = Array.isArray(debugWindow.__OMNIAI_IMAGE_ROUTE_DEBUG__)
|
||||
? debugWindow.__OMNIAI_IMAGE_ROUTE_DEBUG__
|
||||
: [];
|
||||
const entry: ImageRouteDebugEntry = { at: new Date().toISOString(), label, ...payload };
|
||||
debugWindow.__OMNIAI_IMAGE_ROUTE_DEBUG__ = [...previousEntries.slice(-19), entry];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user