Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async uploadToDrive(image, ev) {
ev.preventDefault();
const sheet = await actionSheetCtrl.create({
header: "Share",
buttons: [
{
text: "Upload to OneDrive",
icon: 'cloud',
handler: async (): Promise => {
const imageBlob = b64toBlob(image.url.replace("data:image/png;base64,", ""), 'image/jpg');
let provider = (window as any).mgt.Providers.globalProvider;
if (provider) {
let graphClient = provider.graph.client;
console.log(graphClient);
const loading = await loadingController.create({
message: "Uploading...",
showBackdrop: navigator.userAgent.includes('iPad') === false && window.matchMedia("(min-width: 1200px)").matches ? false : true
const provider = (window as any).mgt.Providers.globalProvider;
const user = provider.graph.client.config.middleware.authenticationProvider._userAgentApplication.account;
await sendCommand(device.id, `https://webboard-app.web.app/boards/${name}/${user.name}/board`);
const toast = await toastCtrl.create({
message: `Opened board on ${device.Model || device.Name}`,
duration: 1800
});
await toast.present();
}
})
})
if (deviceButtons) {
const sheet = await actionSheetCtrl.create({
header: 'Share to your devices',
buttons: deviceButtons
});
await sheet.present();
}
}