File tree Expand file tree Collapse file tree 5 files changed +28
-5
lines changed Expand file tree Collapse file tree 5 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,20 @@ export default function Layout({ children }: { children: ReactNode }) {
125
125
type = "text"
126
126
value = { pendingPeer }
127
127
className = "flex-grow p-3 border border-gray-600 rounded bg-gray-700 text-gray-200"
128
- onChange = { ( e ) => setPendingPeer ( e . target . value ) }
128
+ onChange = { ( e ) => {
129
+ // If pasting a URL, extract the fragment
130
+ if ( e . target . value . includes ( "#" ) ) {
131
+ try {
132
+ const url = new URL ( e . target . value ) ;
133
+ setPendingPeer ( url . hash . slice ( 1 ) ) ;
134
+ } catch {
135
+ // If URL parsing fails, just use the value as-is
136
+ setPendingPeer ( e . target . value ) ;
137
+ }
138
+ } else {
139
+ setPendingPeer ( e . target . value ) ;
140
+ }
141
+ } }
129
142
readOnly = { Boolean ( wasm . connectedPeer ) }
130
143
placeholder = "Enter auth key"
131
144
/>
Original file line number Diff line number Diff line change 2
2
/// <reference types="next/image-types/global" />
3
3
4
4
// NOTE: This file should not be edited
5
- // see https://nextjs.org/docs/pages/building-your-application/configuring /typescript for more information.
5
+ // see https://nextjs.org/docs/pages/api-reference/config /typescript for more information.
Original file line number Diff line number Diff line change 19
19
"class-variance-authority" : " ^0.7.0" ,
20
20
"clsx" : " ^2.1.1" ,
21
21
"lucide-react" : " ^0.454.0" ,
22
- "next" : " 15.0.2 " ,
22
+ "next" : " ^ 15.1.0 " ,
23
23
"next-themes" : " ^0.4.3" ,
24
- "react" : " 19.0.0-rc.1 " ,
25
- "react-dom" : " 19.0.0-rc.1 " ,
24
+ "react" : " ^ 19.0.0" ,
25
+ "react-dom" : " ^ 19.0.0" ,
26
26
"sonner" : " ^1.7.0" ,
27
27
"tailwind-merge" : " ^2.5.4" ,
28
28
"tailwind-scrollbar" : " ^3.1.0" ,
Original file line number Diff line number Diff line change @@ -243,6 +243,16 @@ const FileTransfer: React.FC = () => {
243
243
offset += chunk . byteLength ;
244
244
245
245
if ( offset >= file . size ) {
246
+ // Send file complete message before closing the channel
247
+ const completeMessage : RtcMetadata = {
248
+ type : "file_complete" ,
249
+ fileMetadata : {
250
+ fileName : file . name ,
251
+ fileSize : file . size ,
252
+ } ,
253
+ } ;
254
+ dc . send ( JSON . stringify ( completeMessage ) ) ;
255
+
246
256
cleanupStatsInterval ( ) ;
247
257
const endTime = performance . now ( ) ;
248
258
const totalSeconds = ( endTime - startTime ) / 1000 ;
You can’t perform that action at this time.
0 commit comments