1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-06-12 04:31:35 +02:00

add prettificaiton n fix decode err

This commit is contained in:
Kushagra Gour
2023-09-04 09:32:26 +05:30
parent 8c0b315eeb
commit db744a7fe1

View File

@ -97,12 +97,8 @@ if (location.search) {
} }
const params = new URLSearchParams(location.search); const params = new URLSearchParams(location.search);
window.codeHtml = params.get('html') window.codeHtml = params.get('html') || '';
? decodeURIComponent(params.get('html')) window.codeCss = params.get('css') || '';
: '';
window.codeCss = params.get('css')
? decodeURIComponent(params.get('css'))
: '';
} }
export default class App extends Component { export default class App extends Component {
@ -236,6 +232,8 @@ export default class App extends Component {
db.getSettings(this.defaultSettings).then(result => { db.getSettings(this.defaultSettings).then(result => {
if (window.codeHtml || window.codeCss) { if (window.codeHtml || window.codeCss) {
log('Load item from query params', lastCode); log('Load item from query params', lastCode);
this.prettifyHandler('html');
this.prettifyHandler('css');
this.setCurrentItem(this.state.currentItem).then(() => { this.setCurrentItem(this.state.currentItem).then(() => {
this.refreshEditor(); this.refreshEditor();
}); });