static addNewReviewsWhenOnline() {
    this.restaurantsDb.selectObjects(this.restaurantsDb.pendingReviewsTable)
      .then(pendingReviews => {
        if (pendingReviews.length) {
          const cleanPendingReviews = this.deleteTempProperties(pendingReviews)
          cleanPendingReviews.forEach(pendingReview => {
            this.fetchAddNewReview(pendingReview).then(response => {
              this.restaurantsDb.insertObjects(this.restaurantsDb.reviewsTable, [response]);
            })
          });
        }
      }).then(() => {
        this.restaurantsDb.clearTable(this.restaurantsDb.pendingReviewsTable);
      });
  }
/**
   * Add new review to IndexedDB pending-reviews table
   */
Add new review to IndexedDB pending-reviews table
Add new review to IndexedDB pending - reviews table
static addNewReviewsWhenOnline() {
    this.restaurantsDb.selectObjects(this.restaurantsDb.pendingReviewsTable)
      .then(pendingReviews => {
        if (pendingReviews.length) {
          const cleanPendingReviews = this.deleteTempProperties(pendingReviews)
          cleanPendingReviews.forEach(pendingReview => {
            this.fetchAddNewReview(pendingReview).then(response => {
              this.restaurantsDb.insertObjects(this.restaurantsDb.reviewsTable, [response]);
            })
          });
        }
      }).then(() => {
        this.restaurantsDb.clearTable(this.restaurantsDb.pendingReviewsTable);
      });
  }
static addNewReviewsWhenOnline ( ) { this . restaurantsDb . selectObjects ( this . restaurantsDb . pendingReviewsTable ) . then ( pendingReviews => { if ( pendingReviews . length ) { const cleanPendingReviews = this . deleteTempProperties ( pendingReviews ) cleanPendingReviews . forEach ( pendingReview => { this . fetchAddNewReview ( pendingReview ) . then ( response => { this . restaurantsDb . insertObjects ( this . restaurantsDb . reviewsTable , [ response ] ) ; } ) } ) ; } } ) . then ( ( ) => { this . restaurantsDb . clearTable ( this . restaurantsDb . pendingReviewsTable ) ; } ) ; }
Add new review to IndexedDB pending-reviews table
Add new review to IndexedDB pending - reviews table