File tree Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import type {
1616 FilterApi ,
1717 FunctionReference ,
1818} from "convex/server" ;
19+
1920/**
2021 * A utility for referencing Convex functions in your app's API.
2122 *
Original file line number Diff line number Diff line change @@ -80,10 +80,17 @@ function ServerMessage({
8080 stopStreaming : ( ) => void ;
8181 scrollToBottom : ( ) => void ;
8282} ) {
83- const convexSiteUrl = import . meta. env . VITE_CONVEX_URL . replace (
84- / \. c l o u d $ / ,
85- ".site"
86- ) ;
83+ let convexSiteUrl ;
84+ if ( import . meta. env . VITE_CONVEX_URL . includes ( ".cloud" ) ) {
85+ convexSiteUrl = import . meta. env . VITE_CONVEX_URL . replace (
86+ / \. c l o u d $ / ,
87+ ".site"
88+ ) ;
89+ } else {
90+ const url = new URL ( import . meta. env . VITE_CONVEX_URL ) ;
91+ url . port = String ( Number ( url . port ) + 1 ) ;
92+ convexSiteUrl = url . toString ( ) ;
93+ }
8794
8895 const { text, status } = useStream (
8996 api . chat . getChatBody ,
Original file line number Diff line number Diff line change 6767 }
6868 },
6969 "peerDependencies" : {
70- "convex" : " ~1.16.5 || ~1.17.0 || ~1.18.0 || ~1.19 .0" ,
70+ "convex" : " >=1.23.0 <1.35 .0" ,
7171 "react" : " ~18.3.1 || ~19.0.0" ,
7272 "react-dom" : " ~18.3.1 || ~19.0.0"
7373 },
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import type {
1616 FilterApi ,
1717 FunctionReference ,
1818} from "convex/server" ;
19+
1920/**
2021 * A utility for referencing Convex functions in your app's API.
2122 *
You can’t perform that action at this time.
0 commit comments