safari bug fixes

main
Mike Fix 6 years ago
parent 8c5e584aa2
commit f8a3499156

@ -81,7 +81,7 @@ class Editor extends React.Component {
if (
navigator.userAgent.indexOf('Safari') !== -1 &&
navigator.userAgent.indexOf('Chrome') === -1 &&
format === 'png'
format !== 'svg'
) {
const encodedState = serializeState(this.state)
return api.image(encodedState)

@ -50,12 +50,11 @@ const reverseMappings = mappings.map(mapping =>
)
export const serializeState = state => {
const stateString = JSON.stringify(state)
const stateString = encodeURIComponent(JSON.stringify(state))
return encodeURIComponent(
typeof window !== 'undefined'
? btoa(stateString)
: Buffer.from(stateString).toString('base64')
return encodeURIComponent(typeof window !== 'undefined'
? btoa(stateString)
: Buffer.from(stateString).toString('base64')
)
}

Loading…
Cancel
Save