mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
save: public switch
This commit is contained in:
parent
69f23c9e48
commit
b7f2c7c382
10 changed files with 31 additions and 27 deletions
|
@ -11,6 +11,7 @@ import classnames from 'classnames';
|
|||
type Props = {
|
||||
address: String, // initial?
|
||||
title: String, // initial?
|
||||
is_public: Boolean,
|
||||
|
||||
save_error: String,
|
||||
save_finished: Boolean,
|
||||
|
@ -25,7 +26,7 @@ type Props = {
|
|||
type State = {
|
||||
address: String,
|
||||
title: String,
|
||||
public: Boolean,
|
||||
is_public: Boolean,
|
||||
};
|
||||
|
||||
export class SaveDialog extends React.Component<Props, State> {
|
||||
|
@ -35,7 +36,7 @@ export class SaveDialog extends React.Component<Props, State> {
|
|||
this.state = {
|
||||
address: props.address || '',
|
||||
title: props.title || '',
|
||||
is_public: props.public || false,
|
||||
is_public: props.is_public || false,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -54,11 +55,11 @@ export class SaveDialog extends React.Component<Props, State> {
|
|||
cancelSaving = () => this.props.setMode(MODES.NONE);
|
||||
|
||||
sendSaveRequest = (e, force = false) => {
|
||||
const { title } = this.state;
|
||||
const { title, is_public } = this.state;
|
||||
const address = this.getAddress();
|
||||
|
||||
this.props.sendSaveRequest({
|
||||
title, address, force,
|
||||
title, address, force, is_public
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue