File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,12 @@ const Frame = lazy(() => import('./pages/Frame.js').then(m => m.Frame));
7777export function App ( ) {
7878 const { t} = useTranslation ( "" , { useSuspense : false } ) ;
7979
80+ useEffect ( ( ) => {
81+ if ( ! connected . value ) {
82+ document . title = t ( "app_name" ) ;
83+ }
84+ } , [ connected . value , t ] ) ;
85+
8086 useEffect ( ( ) => {
8187 refresh_access_token ( ) ;
8288 } )
@@ -144,6 +150,8 @@ export function App() {
144150 < LocationProvider >
145151 < Router onRouteChange = { ( ) => {
146152 connected . value = false ;
153+ // Ensure title is reset to translated app name when navigating away from a device connection
154+ document . title = t ( "app_name" ) ;
147155 } } >
148156 < Route path = "/tokens" component = { Tokens } />
149157 < Route path = "/user" component = { User } />
Original file line number Diff line number Diff line change @@ -273,6 +273,8 @@ export class Frame extends Component<{}, FrameState> {
273273 if ( this . interface && this . interface . cancel ) {
274274 this . interface . cancel ( ) ;
275275 }
276+ document . title = i18n . t ( "app_name" ) ;
277+ connected . value = false ;
276278 }
277279
278280 render ( ) {
You can’t perform that action at this time.
0 commit comments