瀏覽代碼

On receiver create, overwrite navigation stack

After creating a group, the group details are shown. When pressing the
browser back button, the user sees the group create page again.

With this fix, the user goes back to the initial messenger overview
instead.
Danilo Bargen 7 年之前
父節點
當前提交
dd59d8cfa8
共有 1 個文件被更改,包括 4 次插入6 次删除
  1. 4 6
      src/partials/messenger.ts

+ 4 - 6
src/partials/messenger.ts

@@ -1443,17 +1443,15 @@ class ReceiverCreateController {
     }
 
     public create(): void {
-        // show loading
+        // Show loading indicator
         this.loading = true;
 
-        // validate first
+        // Save, then go to receiver detail page
         this.execute.execute(this.controllerModel.save())
             .then((receiver: threema.Receiver) => {
-                this.$state.go('messenger.home.detail', receiver);
+                this.$state.go('messenger.home.detail', receiver, {location: 'replace'});
             })
-            .catch((errorCode) => {
-                this.showAddError(errorCode);
-            });
+            .catch(this.showAddError.bind(this));
     }
 }