put users on the main page if no more archived projects (#772)

This commit is contained in:
Echo 2026-01-06 10:25:51 -05:00 committed by GitHub
parent 6a6854f2db
commit ffcb6e6a00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,7 +34,9 @@ class My::ProjectRepoMappingsController < ApplicationController
def unarchive
@project_repo_mapping.unarchive!
redirect_to my_projects_path(show_archived: true), notice: "Back from the dead!"
r = current_user.project_repo_mappings.archived.where.not(id: @project_repo_mapping.id).exists?
p = r ? my_projects_path(show_archived: true) : my_projects_path
redirect_to p, notice: "Back from the dead!"
end
private