diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2017-02-26 08:20:42 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2017-02-26 08:20:42 -0700 |
commit | c48aa433b70a1fd79838e162c1f8e0c00bfa4212 (patch) | |
tree | 9bafce6aaaf779bf913684f9582df81e97fed1a1 | |
parent | 4f114f86a10e314e434b3bdf4d02ef52d508053e (diff) | |
download | sscan-c48aa433b70a1fd79838e162c1f8e0c00bfa4212.tar.gz |
implement abortScanSess
-rw-r--r-- | Main.hs | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -8,7 +8,8 @@ import qualified Data.Text as T import qualified Graphics.Vty as V import Lens.Micro ((&), (.~), (^.)) import System.Directory (getHomeDirectory, - getTemporaryDirectory) + getTemporaryDirectory, + removeDirectoryRecursive) import System.FilePath ((</>)) import System.IO.Temp (createTempDirectory) @@ -101,7 +102,13 @@ beginScanSess st = do & stPageCount .~ (Just 0) abortScanSess :: St -> EventM () St -abortScanSess st = undefined +abortScanSess st = do + maybe (return ()) + (liftIO . removeDirectoryRecursive) + (st^.stScanningSession) + return $ st + & stScanningSession .~ Nothing + & stPageCount .~ Nothing finishScanSess :: St -> EventM () St finishScanSess st = undefined |