FlatFilers / angular-adapter

Angular library to upload CSV files into your Angular applications effortlessly
https://flatfile.io/blog/how-to-create-an-angular-csv-importer-in-2-minutes/
1 stars 7 forks source link

Second Button Press Fails to Fire onComplete #40

Open kevin-induro opened 2 years ago

kevin-induro commented 2 years ago

When I upload the file and complete it, a simple log in the onComplete function shows. However, when I then press the button again and go through the steps as normal, the log in the onCompelte function no longer fires. Upon refreshing the page, the process resets and I can do a single submission again before it stops firing.

In both cases, it appears the uploaded file still shows as Completed in the Flatfile Imports list.

I noticed that the only two calls to the Flatfile API after clicking the submission button were SubmitBatch and getFinalDatabaseView. However, on the second submission, only SubmitBatch is shown as being called.

kevin-induro commented 2 years ago

This perhaps could be related to the token. On a page reload, I'm using a different token. Is this not a bug and perhaps a rate limiting? If so, what are the parameters behind that?

MarkPieszak commented 2 years ago

Hello @kevin-induro! Apologies for not reaching out sooner.

Just to help us figure this one out faster, if you could help with a little more information:

What version of @flatfile/angular are you using? Do you have a sample code / setup of how you're firing up the adapter so we can try to reproduce this better locally?

Thanks so much 🙏

kevin-induro commented 2 years ago

@MarkPieszak I've been dealing with some family issues so I have not been able to get back to this. I'll try to get some code up soon. The version is the latest: 3.1.1

In the mean time, if I could call attention to https://github.com/FlatFilers/angular-adapter/issues/21 and it's PR.

kevin-induro commented 1 year ago

@MarkPieszak This is easily reproduced with your sample project.

  1. Change AppComponent to FlatfileComponent
  2. Add a new AppComponent with just a router-outlet
  3. Create a third component, let's call it TestComponent, with the sole purpose of having something to route to.
  4. Add in a basic router:
    
    const routes: Routes = [
    {
    path: '',
    component: FlatfileComponent,
    },
    {
    path: 'test',
    component: TestComponent,
    },
    ];

@NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule], }) export class AppRoutingModule {}


5. Add a `routerLink` on the `FlatfileComponent` to go to `test`
6. Hook the module appropriately given the above changes
7. Run, click the link, check console for error.