diff --git a/app/views/notifications/index.html.haml b/app/views/notifications/index.html.haml index 1963dce3..63c65b84 100644 --- a/app/views/notifications/index.html.haml +++ b/app/views/notifications/index.html.haml @@ -18,7 +18,10 @@ - if @more_data_available .d-flex.justify-content-center.justify-content-sm-start#paginator - = button_to notifications_path(last_id: @notifications_last_id, type: params[:type]), class: "btn btn-light" do - = t("voc.load") + = button_to t("voc.load"), notifications_path(type: params[:type]), + class: "btn btn-light", + method: :get, + params: { last_id: @notifications_last_id }, + form: { data: { turbo_stream: true } } - provide(:title, generate_title(t(".title"))) diff --git a/app/views/notifications/index.turbo_stream.haml b/app/views/notifications/index.turbo_stream.haml index 7fc5355f..5150c813 100644 --- a/app/views/notifications/index.turbo_stream.haml +++ b/app/views/notifications/index.turbo_stream.haml @@ -7,6 +7,8 @@ = turbo_stream.update "paginator" do - if @more_data_available - = button_to notifications_path(last_id: @notifications_last_id, type: params[:type]), class: "btn btn-light" do - = t("voc.load") - + = button_to t("voc.load"), notifications_path(type: params[:type]), + class: "btn btn-light", + method: :get, + params: { last_id: @notifications_last_id }, + form: { data: { turbo_stream: true } } diff --git a/config/routes.rb b/config/routes.rb index 13344b4b..b273e397 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -146,7 +146,7 @@ Rails.application.routes.draw do get "/public", to: "timeline#public", as: :public_timeline if APP_CONFIG.dig(:features, :public, :enabled) get "/list/:list_name", to: "timeline#list", as: :list_timeline - match "/notifications(/:type)", to: "notifications#index", via: [:get, :post], as: :notifications, defaults: { type: "new" } + get "/notifications(/:type)", to: "notifications#index", as: :notifications, defaults: { type: "new" } post "/inbox/create", to: "inbox#create", as: :inbox_create get "/inbox", to: "inbox#show", as: :inbox