Add favicon. Significantly modify layout and presentation of site by including flexbox for main content. Remove logo from index. Code whitespace updates on Sharing-SQLite
This commit is contained in:
@ -49,23 +49,22 @@ readEncryptedSecret key sec = do
|
||||
if (delete)
|
||||
then return Nothing
|
||||
else return (ET.decodeLatin1 <$> decKey)
|
||||
where
|
||||
incViews :: [SecretEntry] -> String -> IO ()
|
||||
incViews [] _ = return ()
|
||||
incViews (sec : _) db = do
|
||||
conn <- liftIO $ open db
|
||||
liftIO $ execute conn
|
||||
"UPDATE pws SET views = views + 1 WHERE link = ?" (Only (link sec))
|
||||
liftIO $ close conn
|
||||
where
|
||||
incViews :: [SecretEntry] -> String -> IO ()
|
||||
incViews [] _ = return ()
|
||||
incViews (sec : _) db = do
|
||||
conn <- liftIO $ open db
|
||||
liftIO $ execute conn
|
||||
"UPDATE pws SET views = views + 1 WHERE link = ?" (Only (link sec))
|
||||
liftIO $ close conn
|
||||
|
||||
-- Returns True if deletion occurs, informing the caller to not provide
|
||||
-- the successfully retrieved secret to the requestor.
|
||||
deleteExpiredSecret :: [SecretEntry] -> String -> IO Bool
|
||||
deleteExpiredSecret [] _ = return False
|
||||
deleteExpiredSecret [] _ = return False
|
||||
deleteExpiredSecret (sec : _) db = do
|
||||
time <- liftIO $ epochTime
|
||||
if ((date sec) + ((life sec) * 86400) < time) ||
|
||||
(views sec >= maxViews sec)
|
||||
if ((date sec) + ((life sec) * 86400) < time) || (views sec >= maxViews sec)
|
||||
then deleteSec sec db
|
||||
else return False
|
||||
where
|
||||
|
Reference in New Issue
Block a user