darioegb / ngx-translate-routes

MIT License
4 stars 1 forks source link

Missing query parameter after reload #20

Closed MaTo04 closed 4 months ago

MaTo04 commented 4 months ago

Hi @darioegb,

there is an issue with the query parameter after reloading the page. I have for example the following url

http://localhost:4200/Test?Id=1

If i navigate througth the application everything works. But if i reload the page and reading the queryParams from the activated route, the object is empty. Normally i read the query Params like below:

constructor () {
     private activatedRoute: ActivatedRoute,´
}

ngOnInit() {
    const params = await firstValueFrom(this.activatedRoute.queryParams);
    const id = params.Id
}

Since the last update the value cant be read, the object is null. I tested it without your package by comment the implementation in the app module and it works.

darioegb commented 4 months ago

Hi @MaTo04, I apologize for the delayed response. I've been quite occupied lately. Thank you for sharing details about the issue. I'll look into it when I have some free time.

darioegb commented 4 months ago

@MaTo04 Please take a look at the latest version when you have time, I believe it resolves the issue. Let me know.

MaTo04 commented 3 months ago

Hi @darioegb sorry for the delayed answer, i was on vacation. The problem wasn´t solved with the new version. Its the same behavior as before.

darioegb commented 3 months ago

Hi @MaTo04 I hope you had a great vacation! How strange, I did a couple of tests and it worked correctly. By any chance did you try cleaning the localstorage just in case?

MaTo04 commented 3 months ago

I found two problems. Both on my side. First of all i deleted the localstorage (next time i will remember that). The second problam was in my code. So finally it works. Thanks for your help.

darioegb commented 3 months ago

I'm happy to hear that. I will likely need to alter the storage method to avoid clearing local storage during bug fixes. I also plan to ensure compatibility with SSR later and can investigate that issue then.