use URLSearchParams
This commit is contained in:
parent
ede20ca30c
commit
5d359827da
|
@ -18,12 +18,8 @@
|
|||
sendPostMessage({type: 'usw-remove-stylus-button'});
|
||||
|
||||
if (location.pathname === '/api/oauth/style/new') {
|
||||
// Gets the search query string, and get the vendor_data from it.
|
||||
// Which is the id of the style that shall be linked with.
|
||||
const vendorData = window.location.search.split('&')
|
||||
.find(query => query.startsWith('vendor_data'))
|
||||
.split('=')[1];
|
||||
API.styles.get(Number(vendorData)).then(style => {
|
||||
const styleId = Number(new URLSearchParams(location.search).get('vendor_data'));
|
||||
API.styles.get(styleId).then(style => {
|
||||
style.sourceCode = style.tmpSourceCode;
|
||||
sendPostMessage({type: 'usw-fill-new-style', data: style});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user