Skip to content
Snippets Groups Projects
Unverified Commit 72ecddef authored by Alexander Lesnenko's avatar Alexander Lesnenko Committed by GitHub
Browse files
parent 60d861a6
Branches
Tags
No related merge requests found
......@@ -90,8 +90,6 @@ export default class FieldApp extends React.Component {
tab: "general",
};
saveStatus: null;
props: {
databaseId: DatabaseId,
tableId: TableId,
......@@ -115,6 +113,11 @@ export default class FieldApp extends React.Component {
params: any,
};
constructor(props) {
super(props);
this.saveStatusRef = React.createRef();
}
async UNSAFE_componentWillMount() {
const {
databaseId,
......@@ -147,9 +150,9 @@ export default class FieldApp extends React.Component {
}
linkWithSaveStatus = (saveMethod: Function) => async (...args: any[]) => {
this.saveStatus && this.saveStatus.setSaving();
this.saveStatusRef.current && this.saveStatusRef.current.setSaving();
await saveMethod(...args);
this.saveStatus && this.saveStatus.setSaved();
this.saveStatusRef.current && this.saveStatusRef.current.setSaved();
};
onUpdateFieldProperties = this.linkWithSaveStatus(async fieldProps => {
......@@ -238,7 +241,7 @@ export default class FieldApp extends React.Component {
</div>
)}
<div className="absolute top right mt4 mr4">
<SaveStatus ref={this.saveStatus} />
<SaveStatus ref={this.saveStatusRef} />
</div>
{section == null || section === "general" ? (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment