Change Team Drives check to be asynchronous
Without this patch, shouldShowTeamDrives_ calls |callback| synchronously when the --team-drives flag is disabled, and asynchronously if it is enabled. The asynchronous call causes the navigation tree to updated after the appropriate update methods are called, which causes undefined behaviour. This patch moves the check for Team Drives into an asynchronous function called *after* the tree has been synchronously initialized, and simply shows the element if the user has Team Drives (originally, it hid the element, but this means the item may be visible for a split-second. To fix this, it is added as a hidden element by default and then unhidden after the check). This also fixes the existing integration tests to work with the --team-drives flag enabled. Bug: 849497 Cq-Include-Trybots: luci.chromium.try:closure_compilation Change-Id: Ie8e174995ca8b16371f32e8ab780f45748fcc55e Reviewed-on: https://chromium-review.googlesource.com/1103983 Commit-Queue: Sasha Morrissey <sashab@chromium.org> Reviewed-by:Noel Gordon <noel@chromium.org> Cr-Commit-Position: refs/heads/master@{#568336}
Showing
Please register or sign in to comment