Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3797 Lượt xem

Hi,


I am in the process of developing a component on Odoo with Owl the Javascript framework, in this one I make async API requests

I want the user to be able to change the page while the request is processing like in classic web


However when changing the page, I get an error traceback that my Component is destroyed so the processing stops.


It seems that Odoo is implemented this behavior except that I can't find information on how to avoid it.


I need to inherit something?

Call a specific function at the time of destruction (onWillDestroy)

Call the functions in another component that could remain active?


I take all the information possible at this level.


Thanks in advance

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

I also face this issue but didn't find the answer. But in my case, this case is rarely happen. Like in sometime I visit the page, this error show. So I assume it's just trying to do something but because the user switch page too fast, it failed to complete. My solution is just put try except where the error appear to not let that pop up show

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 7 24
5180
0
thg 1 24
1847
1
thg 10 23
2322
0
thg 9 23
1724
1
thg 9 23
2256