on master help sign in
Made things work offline
commit9dfb9446ee62ec0566b628b6ad7016989df17fd6 authoriko <ilyakooo0@gmail.com> dateFri 12 Aug 2022, 17:58 (4 years ago) parent595331b
3 files changed+29−4
backend/Main.purs+24−3 frontend/Pages/EditCipher.elm+1−1 style.css+4
backend/Main.purs+24−3
@@ -7,7 +7,7 @@ import BW (ApiService, CryptoFunctions, Services, CryptoService)
77import BW as WB
88import BW.Logic (decodeCipher, decrypt, encodeCipher, hashPassword, liftPromise)
99import BW.Logic as Logic
10−import BW.Types (CipherResponse, Email(..), Password(..), Urls, cipherTypeCard, cipherTypeIdentity, cipherTypeLogin, cipherTypeSecureNote)
10+import BW.Types (CipherResponse, Email(..), Password(..), Urls, SyncResponse, cipherTypeCard, cipherTypeIdentity, cipherTypeLogin, cipherTypeSecureNote)
1111import Bridge as Bridge
1212import Control.Monad.Error.Class (catchError, throwError)
1313import Data.Argonaut (class DecodeJson)
@@ -140,7 +140,10 @@ main = do
140140 Storage.store storage SyncKey sync
141141 Storage.store storage TokenKey token
142142 send Bridge.LoginSuccessful
143− Bridge.NeedCiphersList -> runWithDecryptionKey performSync
143+ Bridge.NeedCiphersList ->
144+ runWithDecryptionKey do
145+ sendCiphers
146+ performSync
144147 Bridge.NeedsReset -> do
145148 WebStorage.clear storage
146149 Elm.send app Bridge.Reset
@@ -345,7 +348,25 @@ performSync = do
345348 storage <- askAt (Proxy :: _ "storage")
346349 newSync <- liftPromise $ api.getSync unit
347350 liftEffect $ Storage.store storage SyncKey newSync
348− ciphers <- traverse processCipher newSync.ciphers
351+ sendCiphers
352+
353+sendCiphers ::
354+ forall r.
355+ Run
356+ ( storage :: Reader Storage
357+ , app :: Reader Elm
358+ , aff :: Aff
359+ , effect :: Effect
360+ , services :: Reader Services
361+ , crypto :: Reader CryptoService
362+ , key :: Reader SymmetricCryptoKey
363+ | r
364+ )
365+ Unit
366+sendCiphers = do
367+ sync <- getOrReset SyncKey
368+ ciphers <- traverse processCipher sync.ciphers
349369 let
350370 sortedCiphers = Array.sortWith (_.date >>> Down) ciphers
351371 send $ Bridge.LoadCiphers $ Bridge.Sub_LoadCiphers_List $ map _.cipher sortedCiphers
372+ pure unit
frontend/Pages/EditCipher.elm+1−1
@@ -137,7 +137,7 @@ view { fullCipher, passwordGenerator } =
137137 , close = CloseGeneratePassword
138138 , footer =
139139 [ button
140− [ Attr.class "p-button--positive"
140+ [ Attr.class "p-button--positive u-no-margin"
141141 , Ev.onClick <| GeneratePassword x.passwordConfig
142142 ]
143143 [ text "Generate password" ]
style.css+4
@@ -107,3 +107,7 @@ textarea {
107107 min-width: 5rem;
108108 text-align: center;
109109}
110+
111+.p-side-navigation__drawer {
112+ max-width: initial;
113+}