From a5bd67e960e804d16cee85174781266d686c03aa Mon Sep 17 00:00:00 2001 From: Gianluca Date: Thu, 6 Feb 2020 16:51:59 +0000 Subject: [PATCH] fix: fix offline queue --- .../pages/offline-queue/offline-queue.page.html | 17 ++++++++--------- .../pages/offline-queue/offline-queue.page.ts | 14 +++++++------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/app/pages/offline-queue/offline-queue.page.html b/src/app/pages/offline-queue/offline-queue.page.html index 04347cd2..cfa05aea 100644 --- a/src/app/pages/offline-queue/offline-queue.page.html +++ b/src/app/pages/offline-queue/offline-queue.page.html @@ -10,29 +10,28 @@ - - +

Mutation type: - {{ stagedItems[key].operationName }} + {{ task.context.operationName }}

- -
- +
    +
  • {{ item.key }}: {{ item.value }} - -
+ +
- + diff --git a/src/app/pages/offline-queue/offline-queue.page.ts b/src/app/pages/offline-queue/offline-queue.page.ts index 936f270a..d2c24917 100644 --- a/src/app/pages/offline-queue/offline-queue.page.ts +++ b/src/app/pages/offline-queue/offline-queue.page.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { ItemService } from '../../services/sync/item.service'; +import { TaskService } from '../../services/sync/task.service'; @Component({ selector: 'app-offline-queue', @@ -8,8 +8,8 @@ import { ItemService } from '../../services/sync/item.service'; }) export class OfflineQueuePage implements OnInit { interval: number; - constructor(private itemService: ItemService) { } - stagedItems: any; + constructor(private taskService: TaskService) { } + stagedTasks: any; Object = Object; async ngOnInit() { @@ -26,11 +26,11 @@ export class OfflineQueuePage implements OnInit { } private async fetchData() { - const tempItems = await this.itemService.getOfflineItems(); - if (tempItems.length > 0) { - this.stagedItems = tempItems.map(taskItem => taskItem.operation ); + const tempTasks = await this.taskService.getOfflineTasks(); + if (tempTasks.length > 0) { + this.stagedTasks = tempTasks.map(task => task.operation.op); } else { - this.stagedItems = []; + this.stagedTasks = []; } } }