0

I made an app in ionic 4. It work fine on single device. But when same app installed on 3 devices then it behaves like below:

  1. When all devices has opened same screen and one device tried to delete some item(Any operation) then other two devices also reflect the screen changes but does not clear the old items. Just wondering how it reflects other devices even if they are sitting idle, just sharing same screen only :(

  2. For ex if there are 4 items on page one and i delete one item then other two devices has old 4 items and adds 3 item duplicate. i.e it preserves old items and adds 3 more new items i.e it has deleted 4th one and added 3 remaining with old items as well.

  3. I come to know that it actually does not clear the screen on other devices before adding new changes :( . Is this bug in ionic ?

Below are my code :

<ion-content>
  <!-- HEADER -->
  <div class="header">
    <h1>Tables</h1>
    <!-- <div class="avatar">
      <ion-img src="assets\images\face.png"></ion-img>
    </div> -->
  </div>





  <!-- PRODUCTS -->
  <!-- <h1 class="list-header">Booking Tables Available</h1> -->
  <div class="food-list">
    <app-table-item *ngFor="let table of tables1" [table]="table" (clicked)="goToBookTablePage(table)"></app-table-item>
  </div>
</ion-content>

It will display the below screen like this

Screen 1

When i add tables from another device say table 3 then it look like this on other 2 devices:

It adds what i highlighted in yellow box

Can anyone looks this please.

5
  • How are you viewing it on 3 devices? Are you building to them natively using an IDE (Xcode/Android Studio) or are you live reloading them in to simulators? Commented Jul 4, 2021 at 12:44
  • Just installing .apk in all three devices. Building it on IDE VSCodes Commented Jul 4, 2021 at 12:52
  • Now i come to know that why its happening. When i go to firebase and delete some table content manually even then my android device also reflect that changes. It means ionic does not clear the html file before reflection manual firebase DB changes. Question is if i manually delete the rows from firebase then why ionic reflect that changes ? Commented Jul 5, 2021 at 2:03
  • firebase is a real time database. when ever there is a change in database it will update your data on all devices. Commented Jul 5, 2021 at 6:45
  • @NajamUsSaqib You are correct. Thanks for pointing Commented Jul 6, 2021 at 2:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.