fix: post plain objects in WebView2 refresh script
This commit is contained in:
@@ -203,11 +203,11 @@ public class UsageViewModel : INotifyPropertyChanged
|
|||||||
if(!id){
|
if(!id){
|
||||||
let pu=null;
|
let pu=null;
|
||||||
try{pu=await(await fetch('/api/usage',h)).json();}catch(e3){}
|
try{pu=await(await fetch('/api/usage',h)).json();}catch(e3){}
|
||||||
window.chrome.webview.postMessage(JSON.stringify({email:em,orgId:null,usage:(pu&&!pu.error?pu:null)}));
|
window.chrome.webview.postMessage({email:em,orgId:null,usage:(pu&&!pu.error?pu:null)});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const u=await(await fetch('/api/organizations/'+id+'/usage',h)).json();
|
const u=await(await fetch('/api/organizations/'+id+'/usage',h)).json();
|
||||||
window.chrome.webview.postMessage(JSON.stringify({email:em,orgId:id,usage:u}));
|
window.chrome.webview.postMessage({email:em,orgId:id,usage:u});
|
||||||
}catch(ex){window.chrome.webview.postMessage(null);}})();";
|
}catch(ex){window.chrome.webview.postMessage(null);}})();";
|
||||||
|
|
||||||
var resultJson = await Application.Current.Dispatcher.InvokeAsync(async () =>
|
var resultJson = await Application.Current.Dispatcher.InvokeAsync(async () =>
|
||||||
|
|||||||
Reference in New Issue
Block a user