change default config

This commit is contained in:
2022-05-28 21:19:22 +08:00
parent 66d7d3da38
commit ba79f696d9
2 changed files with 7 additions and 7 deletions

View File

@@ -29,8 +29,8 @@ const DEFAULT_CONFIG = {
pressure: false, pressure: false,
easter_egg: true, easter_egg: true,
color_scheme: 'default', color_scheme: 'default',
block_tmp: false, block_tmp: true,
block_words_v3: ['🕷️'], block_words_v4: ['🕷️', '[系统自动代发]'],
whitelist_cw: [], whitelist_cw: [],
ipfs_gateway_list: [ ipfs_gateway_list: [
'https://<hash>.ipfs.dweb.link/', 'https://<hash>.ipfs.dweb.link/',
@@ -65,9 +65,9 @@ export function load_config() {
if (config[key] !== undefined) config[key] = loaded_config[key]; if (config[key] !== undefined) config[key] = loaded_config[key];
}); });
if (loaded_config['block_words_v2']) { if (loaded_config['block_words_v3']) {
config['block_words_v3'] = loaded_config['block_words_v2'].concat( config['block_words_v4'] = loaded_config['block_words_v3'].concat(
config['block_words_v3'], config['block_words_v4'],
); );
} }
@@ -382,7 +382,7 @@ export class ConfigUI extends PureComponent {
/> />
<hr /> <hr />
<ConfigTextArea <ConfigTextArea
id="block_words_v3" id="block_words_v4"
callback={this.save_changes_bound} callback={this.save_changes_bound}
name="设置屏蔽词" name="设置屏蔽词"
description={'包含屏蔽词的树洞会被折叠,每行写一个屏蔽词'} description={'包含屏蔽词的树洞会被折叠,每行写一个屏蔽词'}

View File

@@ -35,7 +35,7 @@ const DZ_NAME = '洞主';
function check_block(info) { function check_block(info) {
return ( return (
((window.config.block_tmp && info.is_tmp) || ((window.config.block_tmp && info.is_tmp) ||
window.config.block_words_v3.some((word) => info.text.includes(word))) && window.config.block_words_v4.some((word) => info.text.includes(word))) &&
!info.can_del !info.can_del
); );
} }