FIX: ensures we don't attempt to save when inserting new policy

FIX: ensures we don’t attempt to save when inserting new policy

diff --git a/assets/javascripts/discourse/controllers/policy-builder.js.es6 b/assets/javascripts/discourse/controllers/policy-builder.js.es6
index 0ce11c3..41baedd 100644
--- a/assets/javascripts/discourse/controllers/policy-builder.js.es6
+++ b/assets/javascripts/discourse/controllers/policy-builder.js.es6
@@ -11,6 +11,7 @@ export default Controller.extend(ModalFunctionality, {
   form: null,
   post: null,
   isSaving: false,
+  insertMode: true,
 
   onShow() {
     if (!this.form) {
diff --git a/assets/javascripts/discourse/templates/modal/policy-builder.hbs b/assets/javascripts/discourse/templates/modal/policy-builder.hbs
index b61d768..2a180b5 100644
--- a/assets/javascripts/discourse/templates/modal/policy-builder.hbs
+++ b/assets/javascripts/discourse/templates/modal/policy-builder.hbs
@@ -60,20 +60,20 @@
 {{/d-modal-body}}
 
 <div class="modal-footer">
-  {{#if post}}
+  {{#if insertMode}}
     {{d-button
-      isLoading=isSaving
       type="button"
       class="btn-primary"
-      label="discourse_policy.builder.save"
-      action=(action "updatePolicy")
+      label="discourse_policy.builder.insert"
+      action=(action "insertPolicy")
     }}
   {{else}}
     {{d-button
+      isLoading=isSaving
       type="button"
       class="btn-primary"
-      label="discourse_policy.builder.insert"
-      action=(action "insertPolicy")
+      label="discourse_policy.builder.save"
+      action=(action "updatePolicy")
     }}
   {{/if}}
 </div>
diff --git a/assets/javascripts/initializers/extend-for-policy.js.es6 b/assets/javascripts/initializers/extend-for-policy.js.es6
index bbc90be..edc5a07 100644
--- a/assets/javascripts/initializers/extend-for-policy.js.es6
+++ b/assets/javascripts/initializers/extend-for-policy.js.es6
@@ -178,6 +178,7 @@ function initializePolicy(api) {
 
     $policy.on("click", ".edit-policy-settings-btn", () => {
       showModal("policy-builder").setProperties({
+        insertMode: false,
         post,
         form,
       });

GitHub sha: b15b18bf