1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-06-10 19:50:51 +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);
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();
});