File tree Expand file tree Collapse file tree
src/HomePage/MainRoomMenu
flat-stores/src/utils/upload-task-manager Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 "@netless/app-slide" : " 0.3.0-canary.20" ,
2626 "@netless/flat-i18n" : " workspace:*" ,
2727 "@netless/flat-pages" : " workspace:*" ,
28- "@netless/flat-stores" : " workspace:*" ,
2928 "@netless/flat-server-api" : " workspace:*" ,
3029 "@netless/flat-service-provider-agora-cloud-recording" : " workspace:*" ,
3130 "@netless/flat-service-provider-agora-rtc-electron" : " workspace:*" ,
3635 "@netless/flat-service-provider-file-preview-netless" : " workspace:*" ,
3736 "@netless/flat-service-provider-file-preview-netless-slide" : " workspace:*" ,
3837 "@netless/flat-services" : " workspace:*" ,
38+ "@netless/flat-stores" : " workspace:*" ,
3939 "antd" : " ^4.23.2" ,
40- "axios" : " ^0.27 .2" ,
40+ "axios" : " ^1.6 .2" ,
4141 "classnames" : " ^2.3.1" ,
4242 "date-fns" : " ^2.29.3" ,
4343 "dotenv-expand" : " ^9.0.0" ,
Original file line number Diff line number Diff line change 1818 "@netless/sync-player" : " ^1.0.7" ,
1919 "@wopjs/dom" : " ^0.1.3" ,
2020 "antd" : " ^4.23.2" ,
21- "axios" : " ^0.27 .2" ,
21+ "axios" : " ^1.6 .2" ,
2222 "classnames" : " ^2.3.1" ,
2323 "date-fns" : " ^2.29.3" ,
2424 "flat-components" : " workspace:*" ,
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ export interface JoinRoomBoxProps {
2121const ROOM_UUID_RE =
2222 / (?: [ A - Z ] { 2 } - ) ? (?: [ 0 - 9 a - f ] { 8 } - [ 0 - 9 a - f ] { 4 } - [ 1 - 5 ] [ 0 - 9 a - f ] { 3 } - [ 8 9 a b ] [ 0 - 9 a - f ] { 3 } - [ 0 - 9 a - f ] { 12 } | 0 0 0 0 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 ) / i;
2323
24+ const INVITE_CODE_RE = / [ 0 - 9 ] { 3 , 4 } [ 0 - 9 ] { 3 } [ 0 - 9 ] { 4 } / ;
25+
2426export const JoinRoomBox = observer < JoinRoomBoxProps > ( function JoinRoomBox ( { onJoinRoom } ) {
2527 const t = useTranslate ( ) ;
2628 const sp = useSafePromise ( ) ;
@@ -152,7 +154,11 @@ export const JoinRoomBox = observer<JoinRoomBoxProps>(function JoinRoomBox({ onJ
152154 async function extractUUIDFromClipboard ( ) : Promise < string | undefined > {
153155 const text = await navigator . clipboard . readText ( ) ;
154156 const m = ROOM_UUID_RE . exec ( text ) ;
155- return m ?. [ 0 ] ;
157+ if ( m ) {
158+ return m [ 0 ] ;
159+ }
160+ const m2 = INVITE_CODE_RE . exec ( text ) ;
161+ return m2 ?. [ 0 ] ;
156162 }
157163
158164 async function handleShowModal ( ) : Promise < void > {
Original file line number Diff line number Diff line change 11import { makeAutoObservable , observable } from "mobx" ;
22import { v4 as v4uuid } from "uuid" ;
3- import Axios , { CancelTokenSource } from "axios" ;
3+ import Axios , { CancelTokenSource , AxiosProgressEvent } from "axios" ;
44import {
55 uploadFinish ,
66 uploadStart ,
@@ -117,8 +117,8 @@ export class UploadTask {
117117 headers : {
118118 "Content-Type" : "multipart/form-data" ,
119119 } ,
120- onUploadProgress : ( e : ProgressEvent ) => {
121- this . updatePercent ( Math . floor ( ( 100 * e . loaded ) / e . total ) ) ;
120+ onUploadProgress : ( e : AxiosProgressEvent ) => {
121+ e . total && this . updatePercent ( Math . floor ( ( 100 * e . loaded ) / e . total ) ) ;
122122 } ,
123123 cancelToken : this . _cancelTokenSource . token ,
124124 } ) ;
You can’t perform that action at this time.
0 commit comments