Add `canUseLocalStorage` guard to other localStorage usages in the repository
## Context In [!226142](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/226142) (Add age indicator toggle to blame preferences dropdown), the `canUseLocalStorage` utility was used to guard `localStorage` access. This utility checks if `localStorage` is actually available and functional in the browser before calling `localStorage.getItem`/`setItem`. Scenarios where `localStorage` may be unavailable: - Private/incognito mode in some browsers - User disabled storage via browser settings - Storage quota exceeded - SSR/non-browser environments Without this guard, the code would throw runtime errors if `localStorage` is unavailable. We have seen related Sentry errors around `localStorage` not being found. ## Proposal As [suggested by @jerasmus](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/226142#note_3136009096), we should add the `canUseLocalStorage` guard to other areas in the repo where we use `localStorage`, such as: - [ ] File Tree Browser (FTB) - [ ] Audit other `localStorage` usages in the repository and add the guard where missing ## References - Original MR: [!226142](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/226142) - [Discussion thread](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/226142#note_3136009096)
issue