From e2544278c969a6dde5d8d2fc4b9442e36682622f Mon Sep 17 00:00:00 2001 From: hole-thu Date: Wed, 5 Oct 2022 10:18:39 +0800 Subject: [PATCH] default allow search --- src/App.js | 1 - src/UserAction.js | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/App.js b/src/App.js index ebab031..ca18a5e 100644 --- a/src/App.js +++ b/src/App.js @@ -21,7 +21,6 @@ class App extends Component { super(props); load_config(); load_attentions(); - window.AS_BACKUP = localStorage['DEFAULT_ALLOW_SEARCH'] ? true : false; window.ANN = localStorage['ANN']; window.LAST_ANN = localStorage['LAST_ANN']; window.TITLE_SECRET = localStorage['TITLE_SECRET'] || ''; diff --git a/src/UserAction.js b/src/UserAction.js index 2b480c4..bb46752 100644 --- a/src/UserAction.js +++ b/src/UserAction.js @@ -523,7 +523,7 @@ export class PostForm extends Component { file_name: '', file_type: '', cw: window.CW_BACKUP || '', - allow_search: window.AS_BACKUP || false, + allow_search: 'AS_BACKUP' in window ? window.AS_BACKUP : true, loading_status: 'done', preview: false, has_poll: !!window.POLL_BACKUP, @@ -548,7 +548,6 @@ export class PostForm extends Component { const { cw, allow_search, has_poll, poll_options } = this.state; window.CW_BACKUP = cw; window.AS_BACKUP = allow_search; - localStorage['DEFAULT_ALLOW_SEARCH'] = allow_search ? '1' : ''; window.POLL_BACKUP = has_poll ? JSON.stringify(poll_options) : null; }