File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed
components/store/editor/chat
server/api/routers/project Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -128,10 +128,7 @@ export class ConversationManager {
128
128
}
129
129
130
130
async addConversationTitle ( conversationId : string , content : string ) {
131
- const title = await api . chat . conversation . generateTitle . mutate ( {
132
- conversationId,
133
- content,
134
- } ) ;
131
+ const title = "RANDOM TITLE" ;
135
132
if ( ! title ) {
136
133
console . error ( 'Error generating conversation title' ) ;
137
134
return ;
Original file line number Diff line number Diff line change @@ -59,12 +59,7 @@ export const projectRouter = createTRPCRouter({
59
59
const result = await app . scrapeUrl ( project . sandboxUrl , {
60
60
formats : [ 'screenshot' ] ,
61
61
onlyMainContent : true ,
62
- actions : [
63
- {
64
- type : 'screenshot' ,
65
- fullPage : true ,
66
- } ,
67
- ] ,
62
+ timeout : 10000 ,
68
63
} ) ;
69
64
70
65
if ( ! result . success ) {
@@ -85,7 +80,6 @@ export const projectRouter = createTRPCRouter({
85
80
86
81
const arrayBuffer = await response . arrayBuffer ( ) ;
87
82
const mimeType = response . headers . get ( 'content-type' ) ?? 'image/png' ;
88
- const path = getScreenshotPath ( project . id , mimeType ) ;
89
83
90
84
const buffer = Buffer . from ( arrayBuffer ) ;
91
85
@@ -96,10 +90,16 @@ export const projectRouter = createTRPCRouter({
96
90
format : 'jpeg' ,
97
91
} ) ;
98
92
93
+ const useCompressed = ! ! compressedImage . buffer ;
94
+ const finalMimeType = useCompressed ? 'image/jpeg' : mimeType ;
95
+ const finalBuffer = useCompressed ? compressedImage . buffer : buffer ;
96
+
97
+ const path = getScreenshotPath ( project . id , finalMimeType ) ;
98
+
99
99
const { data, error } = await ctx . supabase . storage
100
100
. from ( STORAGE_BUCKETS . PREVIEW_IMAGES )
101
- . upload ( path , compressedImage . buffer ?? buffer , {
102
- contentType : mimeType ,
101
+ . upload ( path , finalBuffer , {
102
+ contentType : finalMimeType ,
103
103
} ) ;
104
104
105
105
if ( error ) {
You can’t perform that action at this time.
0 commit comments