A music player that connects to your cloud/distributed storage.
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

Passphrase should be atleast 16 chars long

+71 -19
+7 -4
src/Applications/UI.elm
··· 558 558 Reply.SaveTracks -> 559 559 Core.SaveTracks 560 560 561 + Reply.ShowErrorNotification string -> 562 + ShowNotification (Notifications.stickyError string) 563 + 561 564 Reply.ShowSuccessNotification string -> 562 565 ShowNotification (Notifications.success string) 563 566 564 567 Reply.ShowWarningNotification string -> 565 - ShowNotification (Notifications.warning string) 568 + ShowNotification (Notifications.stickyWarning string) 566 569 567 570 Reply.ShowTracksContextMenu coordinates tracks -> 568 571 Core.ShowTracksContextMenu coordinates tracks ··· 647 650 case Json.Decode.decodeValue (Json.Decode.dict Json.Decode.string) event.data of 648 651 Ok dict -> 649 652 ShowNotification 650 - (Notifications.stickyError 653 + (Notifications.errorWithCode 651 654 ("Could not process the _" 652 655 ++ Dict.fetch "sourceName" "" dict 653 656 ++ "_ source. I got the following response from the source:" ··· 674 677 translateAlienError event err = 675 678 case Alien.tagFromString event.tag of 676 679 Just tag -> 677 - [] 678 - |> Notifications.stickyError err "" 680 + err 681 + |> Notifications.stickyError 679 682 |> ShowNotification 680 683 681 684 Nothing ->
+38 -12
src/Applications/UI/Authentication.elm
··· 26 26 27 27 28 28 29 + -- ⛩ 30 + 31 + 32 + minimumPassphraseLength = 33 + 16 34 + 35 + 36 + passphraseLengthErrorMessage = 37 + "Your passphrase should be atleast *16 characters* long." 38 + 39 + 40 + 29 41 -- 🌳 30 42 31 43 ··· 117 129 ) 118 130 119 131 SignInWithPassphrase method passphrase -> 120 - ( Unauthenticated 121 - , signInWithPassphrase method passphrase 122 - , Just [ ToggleLoadingScreen On ] 123 - ) 132 + if String.length passphrase < minimumPassphraseLength then 133 + ( model 134 + , Cmd.none 135 + , Just [ ShowErrorNotification passphraseLengthErrorMessage ] 136 + ) 137 + 138 + else 139 + ( Unauthenticated 140 + , signInWithPassphrase method passphrase 141 + , Just [ ToggleLoadingScreen On ] 142 + ) 124 143 125 144 SignedIn method -> 126 145 R3.withNothing (Authenticated method) 127 146 128 147 UpdateEncryptionKey method passphrase -> 129 - ( Authenticated method 130 - , passphrase 131 - |> Crypto.Hash.sha256 132 - |> Json.Encode.string 133 - |> Alien.broadcast Alien.UpdateEncryptionKey 134 - |> Ports.toBrain 135 - , Nothing 136 - ) 148 + if String.length passphrase < minimumPassphraseLength then 149 + ( model 150 + , Cmd.none 151 + , Just [ ShowErrorNotification passphraseLengthErrorMessage ] 152 + ) 153 + 154 + else 155 + ( Authenticated method 156 + , passphrase 157 + |> Crypto.Hash.sha256 158 + |> Json.Encode.string 159 + |> Alien.broadcast Alien.UpdateEncryptionKey 160 + |> Ports.toBrain 161 + , Nothing 162 + ) 137 163 138 164 139 165 signIn : Method -> Cmd Msg
+1
src/Applications/UI/Reply.elm
··· 32 32 | SaveSettings 33 33 | SaveSources 34 34 | SaveTracks 35 + | ShowErrorNotification String 35 36 | ShowSuccessNotification String 36 37 | ShowWarningNotification String 37 38 | ShowTracksContextMenu Coordinates (List IdentifiedTrack)
+25 -3
src/Library/Notifications.elm
··· 1 - module Notifications exposing (Action, Kind(..), Notification, Options, contents, dismiss, error, id, kind, options, stickyError, success, warning) 1 + module Notifications exposing (Action, Kind(..), Notification, Options, contents, dismiss, error, errorWithCode, id, kind, options, stickyError, stickyWarning, success, warning) 2 2 3 3 import Chunky exposing (..) 4 4 import Html.Styled as Html exposing (Html) ··· 78 78 (render content) 79 79 80 80 81 - stickyError : String -> String -> List (Action msg) -> Notification msg 82 - stickyError content code actions = 81 + stickyError : String -> Notification msg 82 + stickyError content = 83 + Notification 84 + Error 85 + (hashString 0 content) 86 + { sticky = True 87 + , wasDismissed = False 88 + } 89 + (render content) 90 + 91 + 92 + errorWithCode : String -> String -> List (Action msg) -> Notification msg 93 + errorWithCode content code actions = 83 94 Notification 84 95 Error 85 96 (hashString 0 content) ··· 123 134 124 135 warning : String -> Notification msg 125 136 warning content = 137 + Notification 138 + Warning 139 + (hashString 0 content) 140 + { sticky = False 141 + , wasDismissed = False 142 + } 143 + (render content) 144 + 145 + 146 + stickyWarning : String -> Notification msg 147 + stickyWarning content = 126 148 Notification 127 149 Warning 128 150 (hashString 0 content)