@@ -3,8 +3,8 @@ import { IconNames } from '@blueprintjs/icons';
33import { useHotkeys } from '@mantine/hooks' ;
44import React , { useRef , useState } from 'react' ;
55import * as CopyToClipboard from 'react-copy-to-clipboard' ;
6- import { usePlaygroundConfigurationEncoder } from 'src/features/playground/shareLinks/encoder/Encoder ' ;
7- import ShareLinkState from 'src/features/playground/shareLinks/ShareLinkState ' ;
6+ import JsonEncoderDelegate from 'src/features/playground/shareLinks/encoder/delegates/JsonEncoderDelegate ' ;
7+ import { usePlaygroundConfigurationEncoder } from 'src/features/playground/shareLinks/encoder/EncoderHooks ' ;
88
99import ControlButton from '../ControlButton' ;
1010import { postSharedProgram } from '../sagas/RequestsSaga' ;
@@ -26,17 +26,10 @@ type StateProps = {
2626 shortURL ?: string ;
2727 key : string ;
2828 isSicp ?: boolean ;
29- programConfig : ShareLinkState ;
30- token : Tokens ;
3129} ;
3230
3331type ShareLinkRequestHelperParams = RemoveLast < Parameters < typeof request > > ;
3432
35- export type Tokens = {
36- accessToken : string | undefined ;
37- refreshToken : string | undefined ;
38- } ;
39-
4033export const requestToShareProgram = async (
4134 ...[ path , method , opts ] : ShareLinkRequestHelperParams
4235) => {
@@ -56,7 +49,9 @@ export const ControlBarShareButton: React.FC<ControlBarShareButtonProps> = props
5649
5750 customStringKeyword ;
5851
59- return postSharedProgram ( playgroundConfiguration )
52+ const configuration = playgroundConfiguration . encodeWith ( new JsonEncoderDelegate ( ) ) ;
53+
54+ return postSharedProgram ( configuration )
6055 . then ( ( { shortenedUrl } ) => setShortenedUrl ( shortenedUrl ) )
6156 . catch ( err => showWarningMessage ( err . toString ( ) ) )
6257 . finally ( ( ) => setIsLoading ( false ) ) ;
0 commit comments