mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 00:48:25 +00:00
Window title should change to app name when the user is on the editor page (#1824)
* Fixed: tab title stays default * Added title change code to unmount function * Reversed the title
This commit is contained in:
parent
a02d47e88e
commit
077c297ecb
1 changed files with 7 additions and 0 deletions
|
|
@ -105,6 +105,10 @@ class Editor extends React.Component {
|
|||
};
|
||||
}
|
||||
|
||||
setWindowTitle(name) {
|
||||
document.title = name ? `${name} - Tooljet` : `Untitled App - Tooljet`;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.fetchApps(0);
|
||||
this.fetchApp();
|
||||
|
|
@ -166,6 +170,7 @@ class Editor extends React.Component {
|
|||
if (this.state.socket) {
|
||||
this.state.socket?.close();
|
||||
}
|
||||
document.title = 'Tooljet - Dashboard';
|
||||
}
|
||||
|
||||
getWebsocketUrl = () => {
|
||||
|
|
@ -324,6 +329,7 @@ class Editor extends React.Component {
|
|||
console.log('Default component state computed and set');
|
||||
this.runQueries(data.data_queries);
|
||||
});
|
||||
this.setWindowTitle(data.name);
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -660,6 +666,7 @@ class Editor extends React.Component {
|
|||
this.setState({
|
||||
app: { ...this.state.app, name: newName },
|
||||
});
|
||||
this.setWindowTitle(newName);
|
||||
};
|
||||
|
||||
toggleQueryEditor = () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue