// eslint-disable-next-line import/no-extraneous-dependencies
import { app } from 'electron'
import Config from 'electron-config'
import fs from 'fs'
import log from 'electron-log'
import path from 'path'





import {
  copyFile,
  generateTempFilepath,
  uploadFile,
} from '.'





const config = new Config





const handleScreenshot = async filename => {
  log.info('Handling screenshot')

  const filepath = path.resolve(app.getPath('desktop'), filename)
  const tempFilepath = generateTempFilepath(path.extname(filename), filename)

  try {
    fs.readFileSync(filepath)
  } catch (error) {
    log.error('Failed to read file. Aborting.')
    return
  }

  await uploadFile(await copyFile(filepath, tempFilepath))

  if (config.get('deleteAfterUpload')) {
    fs.unlinkSync(filepath)
  }
}





export { handleScreenshot }

@@ -668,25 +668,8 @@
 ait 
-uploadFile(await 
 copy
@@ -696,16 +696,48 @@
 ilepath)
+%0A  await uploadFile(tempFilepath
 )%0A%0A  if 

Deobfuscate some confusing code