From db744a7fe131f0000b2d32be0a0c6e5c6cd9ffcb Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Mon, 4 Sep 2023 09:32:26 +0530 Subject: [PATCH] add prettificaiton n fix decode err --- src/components/app.jsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/app.jsx b/src/components/app.jsx index d17aefd..71bac5d 100644 --- a/src/components/app.jsx +++ b/src/components/app.jsx @@ -97,12 +97,8 @@ if (location.search) { } const params = new URLSearchParams(location.search); - window.codeHtml = params.get('html') - ? decodeURIComponent(params.get('html')) - : ''; - window.codeCss = params.get('css') - ? decodeURIComponent(params.get('css')) - : ''; + window.codeHtml = params.get('html') || ''; + window.codeCss = params.get('css') || ''; } export default class App extends Component { @@ -236,6 +232,8 @@ export default class App extends Component { db.getSettings(this.defaultSettings).then(result => { if (window.codeHtml || window.codeCss) { log('Load item from query params', lastCode); + this.prettifyHandler('html'); + this.prettifyHandler('css'); this.setCurrentItem(this.state.currentItem).then(() => { this.refreshEditor(); });