浏览代码

Fix for issues found in production

Matt Raible 7 年前
父节点
当前提交
db269c7499
共有 4 个文件被更改,包括 6 次插入8 次删除
  1. 2
    6
      client/src/pages/beer/beer-modal.ts
  2. 2
    0
      client/src/pages/beer/beer.ts
  3. 1
    1
      client/src/providers/giphy-service.ts
  4. 1
    1
      deploy.sh

+ 2
- 6
client/src/pages/beer/beer-modal.ts 查看文件

@@ -36,14 +36,10 @@ export class BeerModalPage {
36 36
     this.beerService.save(form).subscribe(result => {
37 37
       let toast = this.toastCtrl.create({
38 38
         message: 'Beer "' + form.name + '" ' + ((update) ? 'updated' : 'added') + '.',
39
-        duration: 2000,
40
-        position: 'top'
39
+        duration: 2000
41 40
       });
42 41
       toast.present();
43
-      // this should work, but doesn't refresh model
44
-      //this.viewCtrl.dismiss();
45
-      // this refreshes model
46
-      this.navCtrl.push(BeerPage);
42
+      this.dismiss();
47 43
     }, error => this.error = error)
48 44
   }
49 45
 }

+ 2
- 0
client/src/pages/beer/beer.ts 查看文件

@@ -31,6 +31,8 @@ export class BeerPage {
31 31
   openModal(beerId) {
32 32
     let modal = this.modalCtrl.create(BeerModalPage, beerId);
33 33
     modal.present();
34
+    // refresh data after modal dismissed
35
+    modal.onDidDismiss(() => this.ionViewDidLoad())
34 36
   }
35 37
 
36 38
   remove(beer) {

+ 1
- 1
client/src/providers/giphy-service.ts 查看文件

@@ -6,7 +6,7 @@ import { Observable } from 'rxjs';
6 6
 // http://tutorials.pluralsight.com/front-end-javascript/getting-started-with-angular-2-by-building-a-giphy-search-application
7 7
 export class GiphyService {
8 8
 
9
-  giphyApi = '//api.giphy.com/v1/gifs/search?api_key=dc6zaTOxFJmzC&q=';
9
+  giphyApi = 'https://api.giphy.com/v1/gifs/search?api_key=dc6zaTOxFJmzC&q=';
10 10
 
11 11
   constructor(public http: Http) {
12 12
   }

+ 1
- 1
deploy.sh 查看文件

@@ -54,7 +54,7 @@ serverUri=https://`app_domain pwa-server`
54 54
 
55 55
 # Deploy the client
56 56
 cd $r/client
57
-rm -rf dist
57
+npm run clean
58 58
 # replace the server URL in the client
59 59
 sed -i -e "s|http://localhost:8080|$serverUri|g" $r/client/src/app/app.module.ts
60 60
 npm install && ionic build ios