FIX: Add %{base_url} to URL.

FIX: Add %{base_url} to URL.

Follow-up to 117d9e0f0bfe9a7c7f16624d2699feba0579f25d.

diff --git a/assets/javascripts/discourse/connectors/top-notices/encrypt.hbs b/assets/javascripts/discourse/connectors/top-notices/encrypt.hbs
index bf835e5..fe11957 100644
--- a/assets/javascripts/discourse/connectors/top-notices/encrypt.hbs
+++ b/assets/javascripts/discourse/connectors/top-notices/encrypt.hbs
@@ -4,7 +4,7 @@
       <div class="close" {{action (mut noticeStatus) 'dismissed'}}>
         {{d-icon "times"}}
       </div>
-      {{{i18n "encrypt.no_backup_warn"}}}
+      {{{i18n "encrypt.no_backup_warn" basePath=basePath}}}
     </div>
   </div>
 {{/if}}
diff --git a/assets/javascripts/discourse/connectors/top-notices/encrypt.js.es6 b/assets/javascripts/discourse/connectors/top-notices/encrypt.js.es6
index a6f82c6..c66ecc5 100644
--- a/assets/javascripts/discourse/connectors/top-notices/encrypt.js.es6
+++ b/assets/javascripts/discourse/connectors/top-notices/encrypt.js.es6
@@ -13,6 +13,7 @@ export default {
     const status = getEncryptionStatus(currentUser);
 
     component.setProperties({
+      basePath: Discourse.BaseUri,
       model: args.model,
       isEncryptEnabled: status !== ENCRYPT_DISABLED,
       isEncryptActive: status === ENCRYPT_ACTIVE,
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 13e2a9d..9f8ba5a 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -5,7 +5,7 @@ en:
       decrypting: "Decrypting..."
       decryption_failed: "This message could not be decrypted."
 
-      no_backup_warn: "You enabled encryption, but did not generate any paper keys. Without any paper keys, you risk losing access to your encrypted messages. To generate one, please navigate to <a href='%{base_url}/my/preferences/account'>user preferences page</a>, press the <kbd>Generate Paper Key</kbd> button and follow the instructions."
+      no_backup_warn: "You enabled encryption, but did not generate any paper keys. Without any paper keys, you risk losing access to your encrypted messages. To generate one, please navigate to <a href='%{basePath}/my/preferences/account'>user preferences page</a>, press the <kbd>Generate Paper Key</kbd> button and follow the instructions."
 
       integrity_check_pass: "The integrity check for this post has passed."
       integrity_check_fail: "The integrity check for this post has failed ({{fields}} mismatch)."

GitHub sha: f11e12db

2 Likes