xwikisas / application-onlyoffice-connector

Edit attachments with OnlyOffice
GNU Lesser General Public License v2.1
0 stars 5 forks source link

Buttons appear twice #15

Closed ane-gabriela closed 4 months ago

ane-gabriela commented 4 years ago

On a page with translations, especially on the FR one, once the page is refreshed 2-3 times the buttons from Attachments that are use to create a new doc, xls, ppt appear as doubled.

This happened on local instance - 9.11 and Cloud - 11.3.5 with Chrome 78

Buttons_9 11

Buttons_11 3 5

polx commented 4 years ago

This is related to the fact that the creation of the buttons first triggers a server call whose result only sets the resulting dom elements. Two such calls can be made and will not be prevented as long as the server call has not finished.

A quick fix can be done but I wonder if we should not remove these server calls which are just there for rendering purposes.

polx commented 4 years ago

A fix is proposed in branch issue-15-buttons-double.

mflorea commented 4 years ago

If we keep the server call then I would add a placeholder element with the loading class while waiting for the response to come.

polx commented 4 years ago

Hello @mflorea , my latest commit 10a649ec2f693da421bfaa4a39173b92301c2939 now makes the equivalent work as the http requests but only on JS. This means that the duplicates are gone. This also means that it is slightly fast. Thanks to review. Paul