Commit 53f8e361 authored by A. Unique TensorFlower's avatar A. Unique TensorFlower Committed by TensorFlower Gardener
Browse files

Fix hash URLs

URLs like localhost:6006/#graphs weren't working. This was because the
`USE_HASH` property of `TF.Globals` was being read as false by the
router, even though `tf-tensorboard` was trying to set it to `true`. The
problem was that `tf-tensorboard` was only setting to true the _copy_ of
`USE_HASH` that it created at import time. The solution adopted here is
to let `globals.ts` close over a private `use_hash`, and expose a getter
and setter. An alternate solution is to expose a constant object
`{use_hash: false}`; importing modules would copy the _reference_ to
this object, so their mutations would pass through. This alternate
solution would perhaps be more elegant if we had more properties.

Test Plan:
  - Load http://localhost:6006/.
  - Change the URL to http://localhost:6006/#graphs.
  - Note that the view updates.

PiperOrigin-RevId: 157277248
parent 73d2f9c9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment