@@ -72,17 +72,17 @@ const OpenSharedProjectPage = () => {
7272 const [ name , setName ] = useState ( "" ) ;
7373 const { sharedState, header, dataset, projectText } =
7474 useProjectPreload ( setName ) ;
75- const { shortId } = useParams ( ) ;
75+ const { shareId } = useParams ( ) ;
7676
7777 const handleOpenProject = useCallback ( ( ) => {
7878 if ( ! header || ! projectText ) return ;
7979 loadProject ( { header : { ...header , name } , text : projectText } , name ) ;
8080 logging . event ( {
8181 type : "import-shared-project-complete" ,
82- detail : { shortId } ,
82+ detail : { shareId } ,
8383 } ) ;
8484 navigate ( createDataSamplesPageUrl ( ) ) ;
85- } , [ loadProject , header , projectText , name , navigate , logging , shortId ] ) ;
85+ } , [ loadProject , header , projectText , name , navigate , logging , shareId ] ) ;
8686
8787 if ( sharedState === SharedState . Failed ) {
8888 return < ErrorPreloading /> ;
@@ -141,7 +141,7 @@ const OpenSharedProjectPage = () => {
141141 color = "brand.600"
142142 textDecoration = "underline"
143143 href = { `https://makecode.microbit.org/${ encodeURIComponent (
144- shortId !
144+ shareId !
145145 ) } `}
146146 >
147147 { children }
@@ -373,7 +373,7 @@ const ErrorPreloading = () => {
373373 * it update the name on preload via a callback.
374374 */
375375const useProjectPreload = ( setName : ( name : string ) => void ) => {
376- const { shortId } = useParams ( ) ;
376+ const { shareId } = useParams ( ) ;
377377 const logging = useLogging ( ) ;
378378
379379 const [ sharedState , setSharedState ] = useState < SharedState > (
@@ -385,15 +385,15 @@ const useProjectPreload = (setName: (name: string) => void) => {
385385 const [ dataset , setDataset ] = useState < ActionData [ ] > ( ) ;
386386
387387 useEffect ( ( ) => {
388- if ( ! shortId ) return ;
388+ if ( ! shareId ) return ;
389389 let cleanedUp = false ;
390390 const loadAsync = async ( ) => {
391391 try {
392392 logging . event ( {
393393 type : "import-shared-project-start" ,
394- detail : { shortId } ,
394+ detail : { shareId } ,
395395 } ) ;
396- const header = await fetchSharedHeader ( shortId ) ;
396+ const header = await fetchSharedHeader ( shareId ) ;
397397 if ( cleanedUp ) {
398398 throw new Error ( "Cancelled" ) ;
399399 }
@@ -414,12 +414,12 @@ const useProjectPreload = (setName: (name: string) => void) => {
414414 setProjectText ( text ) ;
415415 logging . event ( {
416416 type : "import-shared-project-preloaded" ,
417- detail : { shortId } ,
417+ detail : { shareId } ,
418418 } ) ;
419419 } catch ( e : unknown ) {
420420 logging . event ( {
421421 type : "import-shared-project-failed" ,
422- detail : { shortId , error : e } ,
422+ detail : { shareId , error : e } ,
423423 } ) ;
424424 if ( ! cleanedUp ) {
425425 setSharedState ( SharedState . Failed ) ;
@@ -430,7 +430,7 @@ const useProjectPreload = (setName: (name: string) => void) => {
430430 return ( ) => {
431431 cleanedUp = true ;
432432 } ;
433- } , [ logging , shortId , setName ] ) ;
433+ } , [ logging , shareId , setName ] ) ;
434434 return {
435435 sharedState,
436436 header,
@@ -440,9 +440,9 @@ const useProjectPreload = (setName: (name: string) => void) => {
440440 } ;
441441} ;
442442
443- const fetchSharedHeader = async ( shortId : string ) : Promise < Header > => {
443+ const fetchSharedHeader = async ( shareId : string ) : Promise < Header > => {
444444 const headerResponse = await fetch (
445- `https://www.makecode.com/api/${ encodeURIComponent ( shortId ) } `
445+ `https://www.makecode.com/api/${ encodeURIComponent ( shareId ) } `
446446 ) ;
447447 if ( ! headerResponse . ok ) {
448448 throw new Error ( "Network error" ) ;
0 commit comments