Skip to content

Commit

Permalink
Assign projects for picker
Browse files Browse the repository at this point in the history
  • Loading branch information
elias-ba committed Oct 24, 2024
1 parent 9ca51a3 commit 2ec29c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/lightning_web/live/dashboard_live/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ defmodule LightningWeb.DashboardLive.Index do
require Logger

on_mount {LightningWeb.Hooks, :project_scope}
on_mount {LightningWeb.Hooks, :assign_projects}

@impl true
def mount(_params, _session, socket) do
Expand Down
10 changes: 4 additions & 6 deletions lib/lightning_web/live/dashboard_live/user_projects_section.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ defmodule LightningWeb.DashboardLive.UserProjectsSection do
order_by: [{new_sort_direction, order_column}]
)

socket =
socket
|> assign(:projects, projects)
|> assign(sort_key, new_sort_direction)

{:noreply, socket}
{:noreply,
socket
|> assign(:projects, projects)
|> assign(sort_key, new_sort_direction)}
end

defp switch_sort_direction(:asc), do: :desc
Expand Down

0 comments on commit 2ec29c8

Please sign in to comment.