|
|
|
@ -145,13 +145,14 @@ export const loadData = async (attachment: any) => {
|
|
|
|
|
// deleteData :: (RelativePath -> IO Unit)
|
|
|
|
|
// Attachment ->
|
|
|
|
|
// IO Unit
|
|
|
|
|
export const deleteData = () => {
|
|
|
|
|
return async (attachment: { path: string; thumbnail: any; screenshot: any }) => {
|
|
|
|
|
// NOTE Flattening this function seemed to have worked
|
|
|
|
|
export const deleteData = async (attachment: { path: string; thumbnail: any; screenshot: any }) => {
|
|
|
|
|
if (!isValid(attachment)) {
|
|
|
|
|
throw new TypeError('deleteData: attachment is not valid');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const { path, thumbnail, screenshot } = attachment;
|
|
|
|
|
|
|
|
|
|
if (isString(path)) {
|
|
|
|
|
await deleteOnDisk(path);
|
|
|
|
|
}
|
|
|
|
@ -164,7 +165,7 @@ export const deleteData = () => {
|
|
|
|
|
await deleteOnDisk(screenshot.path);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
type CaptureDimensionType = { contentType: string; path: string };
|
|
|
|
|
|
|
|
|
|
export const captureDimensionsAndScreenshot = async (
|
|
|
|
|