File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -352,16 +352,27 @@ function SwitchToPAYG() {
352352 } ) ;
353353 break ;
354354
355- case "teamSubscription2" :
355+ case "teamSubscription2" : {
356+ let teamId ;
357+ const parsed = attributionId && AttributionId . parse ( attributionId ) ;
358+ if ( parsed && parsed . kind === "team" ) {
359+ teamId = parsed . teamId ;
360+ }
361+ if ( ! teamId ) {
362+ // this should never be the case, but we need to re-parse the attribution id.
363+ alert ( "Missing Organization ID." ) ;
364+ break ;
365+ }
356366 getGitpodService ( )
357- . server . cancelTeamSubscription ( oldSubscriptionId )
367+ . server . cancelTeamSubscription ( teamId )
358368 . catch ( ( error ) => {
359369 console . error (
360370 "Failed to cancel old subscription. We should take care of that async." ,
361371 error ,
362372 ) ;
363373 } ) ;
364374 break ;
375+ }
365376 }
366377 setPageState ( ( s ) => ( { ...s , phase : "done" } ) ) ;
367378 return ;
You can’t perform that action at this time.
0 commit comments