Skip to content

Commit

Permalink
created useEffect so that title properly changes in modal
Browse files Browse the repository at this point in the history
  • Loading branch information
AAfghahi committed Jan 12, 2022
1 parent b621a25 commit ed14a6f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion superset-frontend/src/SqlLab/components/SaveQuery/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import React, { useState } from 'react';
import React, { useState, useEffect } from 'react';
import { Row, Col, Input, TextArea } from 'src/common/components';
import { t, styled } from '@superset-ui/core';
import Button from 'src/components/Button';
Expand Down Expand Up @@ -90,6 +90,11 @@ export default function SaveQuery({
description,
});

useEffect(() => {
if (!isSaved) {
setLabel(defaultLabel);
}
}, [defaultLabel]);
const close = () => {
setShowSave(false);
};
Expand Down
1 change: 1 addition & 0 deletions superset-frontend/src/SqlLab/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export type Query = {
queryLimit: number;
limitingFactor: string;
};

export interface QueryEditor {
dbId?: number;
title: string;
Expand Down

0 comments on commit ed14a6f

Please sign in to comment.