Skip to content

Commit 06ffcc1

Browse files
committed
Skip account linking if the basecamp integration is alreadys setup
1 parent 77cdd47 commit 06ffcc1

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

app/controllers/integrations/basecamps_controller.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ def new
33
end
44

55
def create
6-
integration = Integration::Basecamp.create(owner: Current.user)
7-
redirect_to integration.authorization_url, allow_other_host: true
6+
integration = Integration::Basecamp.find_or_create_by(owner: Current.user)
7+
8+
unless integration.setup?
9+
redirect_to integration.authorization_url, allow_other_host: true
10+
end
811
end
912
end
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<% @hide_footer_frames = true %>
2+
3+
<div data-controller="popup-window">
4+
<p>You have already setup your Basecamp integration</p>
5+
6+
<button class="btn" data-action="popup-window#close">Ok</button>
7+
</div>

0 commit comments

Comments
 (0)