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 }) {
125125 type = "text"
126126 value = { pendingPeer }
127127 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+ } }
129142 readOnly = { Boolean ( wasm . connectedPeer ) }
130143 placeholder = "Enter auth key"
131144 />
Original file line number Diff line number Diff line change 22/// <reference types="next/image-types/global" />
33
44// 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 1919 "class-variance-authority" : " ^0.7.0" ,
2020 "clsx" : " ^2.1.1" ,
2121 "lucide-react" : " ^0.454.0" ,
22- "next" : " 15.0.2 " ,
22+ "next" : " ^ 15.1.0 " ,
2323 "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" ,
2626 "sonner" : " ^1.7.0" ,
2727 "tailwind-merge" : " ^2.5.4" ,
2828 "tailwind-scrollbar" : " ^3.1.0" ,
Original file line number Diff line number Diff line change @@ -243,6 +243,16 @@ const FileTransfer: React.FC = () => {
243243 offset += chunk . byteLength ;
244244
245245 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+
246256 cleanupStatsInterval ( ) ;
247257 const endTime = performance . now ( ) ;
248258 const totalSeconds = ( endTime - startTime ) / 1000 ;
You can’t perform that action at this time.
0 commit comments