diff --git a/src/UserAction.js b/src/UserAction.js index db18ea3..dd29f44 100644 --- a/src/UserAction.js +++ b/src/UserAction.js @@ -362,8 +362,8 @@ export class PostForm extends Component { super(props); this.state = { text: '', - cw: '', - allow_search: false, + cw: window.CW_BACKUP || '', + allow_search: window.AS_BACKUP || false, loading_status: 'done', img_tip: null, preview: false, @@ -381,6 +381,11 @@ export class PostForm extends Component { if (this.area_ref.current) this.area_ref.current.focus(); } + componentWillUnmount() { + window.CW_BACKUP = this.state.cw; + window.AS_BACKUP = this.state.allow_search; + } + on_allow_search_change(event) { this.setState({ allow_search: event.target.checked, @@ -429,6 +434,7 @@ export class PostForm extends Component { }); this.area_ref.current.clear(); this.props.on_complete(); + window.CW_BACKUP = ''; }) .catch((e) => { console.error(e); @@ -644,6 +650,7 @@ export class PostForm extends Component { 允许被搜索 diff --git a/src/infrastructure/widgets.js b/src/infrastructure/widgets.js index bfc4569..aaba2ce 100644 --- a/src/infrastructure/widgets.js +++ b/src/infrastructure/widgets.js @@ -64,7 +64,7 @@ class LoginPopupSelf extends Component { e.preventDefault(); tar.href = '/_login?p=thuhole&token=' + ref.current.value; console.log(tar); - alert('应T大树洞管理员要求,已停止T大树洞token登陆'); + alert('T大树洞已经没有啦😭'); } render() {