summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/trigger_controller.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/app/controllers/trigger_controller.rb b/app/controllers/trigger_controller.rb
index 0de9223..a1bab65 100644
--- a/app/controllers/trigger_controller.rb
+++ b/app/controllers/trigger_controller.rb
@@ -91,6 +91,8 @@ class TriggerController < ApplicationController
if fax_document.save
Notifications.new_fax(fax_document).deliver
+ @last_fax_document = fax_document
+
begin
File.delete(pdf_file)
rescue => e
@@ -110,14 +112,10 @@ class TriggerController < ApplicationController
end
if errors.count == 0
- # Reload FaxDocument#show
- #
- PrivatePub.publish_to("/fax_documents/#{fax_document.id}", "location.reload();")
-
# Indicate a new fax in the navigation bar.
#
- if fax_document.fax_accountable.class == User
- user = fax_document.fax_accountable
+ if @last_fax_document.fax_account.fax_accountable.class == User
+ user = @last_fax_document.fax_account.fax_accountable
PrivatePub.publish_to("/users/#{user.id}/messages/new", "$('#new_voicemail_or_fax_indicator').hide('fast').show('slow');")
end