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.

Show notification when processing sources

+38 -16
+29 -13
src/Applications/UI.elm
··· 186 186 -- Brain 187 187 ----------------------------------------- 188 188 Core.ProcessSources -> 189 - ( model 190 - , [ ( "origin" 191 - , Json.Encode.string (Common.urlOrigin model.url) 192 - ) 193 - , ( "sources" 194 - , Json.Encode.list Sources.Encoding.encode model.sources.collection 195 - ) 196 - , ( "tracks" 197 - , Json.Encode.list Tracks.Encoding.encodeTrack model.tracks.collection.untouched 198 - ) 199 - ] 189 + let 190 + notification = 191 + Notifications.warning "Processing sources …" 192 + 193 + notificationId = 194 + Notifications.id notification 195 + 196 + sources = 197 + model.sources 198 + 199 + newSources = 200 + { sources | processingNotificationId = Just notificationId } 201 + in 202 + [ ( "origin" 203 + , Json.Encode.string (Common.urlOrigin model.url) 204 + ) 205 + , ( "sources" 206 + , Json.Encode.list Sources.Encoding.encode model.sources.collection 207 + ) 208 + , ( "tracks" 209 + , Json.Encode.list Tracks.Encoding.encodeTrack model.tracks.collection.untouched 210 + ) 211 + ] 200 212 |> Json.Encode.object 201 213 |> Alien.broadcast Alien.ProcessSources 202 214 |> Ports.toBrain 203 - ) 215 + |> R2.withModel { model | sources = newSources } 216 + |> N5.andThen2 (update <| ShowNotification notification) 204 217 205 218 Core.SaveEnclosedUserData -> 206 219 model ··· 409 422 ----------------------------------------- 410 423 -- Notifications 411 424 ----------------------------------------- 412 - DismissNotification args -> 425 + Core.DismissNotification args -> 413 426 UI.Notifications.dismissNotification model args 414 427 415 428 RemoveNotification { id } -> ··· 476 489 477 490 Reply.Chill -> 478 491 Bypass 492 + 493 + Reply.DismissNotification opts -> 494 + Core.DismissNotification opts 479 495 480 496 Reply.FillQueue -> 481 497 Core.FillQueue
+1 -1
src/Applications/UI/Notifications.elm
··· 170 170 171 171 warningStyles : List Css.Style 172 172 warningStyles = 173 - [ Css.backgroundColor (Color.toElmCssColor UI.Kit.colors.warning) ] 173 + [ Css.backgroundColor (Css.rgba 255 255 255 0.2) ]
+1
src/Applications/UI/Reply.elm
··· 18 18 = ActiveQueueItemChanged (Maybe Queue.Item) 19 19 | AddSourceToCollection Source 20 20 | Chill 21 + | DismissNotification { id : Int } 21 22 | FillQueue 22 23 | GoToPage Page 23 24 | InsertDemo
+6 -1
src/Applications/UI/Sources.elm
··· 8 8 import Material.Icons.Content as Icons 9 9 import Material.Icons.Navigation as Icons 10 10 import Material.Icons.Notification as Icons 11 + import Notifications exposing (Notification) 11 12 import Replying exposing (R3D3, return) 12 13 import Return2 13 14 import Return3 ··· 34 35 , currentTime : Time.Posix 35 36 , form : Form.Model 36 37 , isProcessing : Bool 38 + , processingNotificationId : Maybe Int 37 39 } 38 40 39 41 ··· 43 45 , currentTime = Time.millisToPosix 0 44 46 , form = Form.initialModel 45 47 , isProcessing = False 48 + , processingNotificationId = Nothing 46 49 } 47 50 48 51 ··· 75 78 FinishedProcessing -> 76 79 ( { model | isProcessing = False } 77 80 , Cmd.none 78 - , Nothing 81 + , Maybe.map 82 + (\id -> [ UI.Reply.DismissNotification { id = id } ]) 83 + model.processingNotificationId 79 84 ) 80 85 81 86 Process ->
+1 -1
src/Library/Notifications.elm
··· 126 126 Notification 127 127 Warning 128 128 (hashString 0 content) 129 - { sticky = False 129 + { sticky = True 130 130 , wasDismissed = False 131 131 } 132 132 (render content)