fix: attention
This commit is contained in:
12
src/Flows.js
12
src/Flows.js
@@ -895,8 +895,7 @@ class FlowItemRow extends PureComponent {
|
|||||||
hidden: window.config.block_words_v2.some((word) =>
|
hidden: window.config.block_words_v2.some((word) =>
|
||||||
props.info.text.includes(word),
|
props.info.text.includes(word),
|
||||||
) && !props.info.can_del || this.needFold,
|
) && !props.info.can_del || this.needFold,
|
||||||
attention:
|
attention: props.info.attention,
|
||||||
props.attention_override === null ? false : props.attention_override,
|
|
||||||
cached: true, // default no display anything
|
cached: true, // default no display anything
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1258,9 +1257,6 @@ function FlowChunk(props) {
|
|||||||
mode={props.mode}
|
mode={props.mode}
|
||||||
show_sidebar={props.show_sidebar}
|
show_sidebar={props.show_sidebar}
|
||||||
token={token}
|
token={token}
|
||||||
attention_override={
|
|
||||||
props.mode === 'attention_finished' ? true : null
|
|
||||||
}
|
|
||||||
deletion_detect={props.deletion_detect}
|
deletion_detect={props.deletion_detect}
|
||||||
search_param={props.search_param}
|
search_param={props.search_param}
|
||||||
/>
|
/>
|
||||||
@@ -1357,11 +1353,10 @@ class SubFlow extends PureComponent {
|
|||||||
load_page(page) {
|
load_page(page) {
|
||||||
const failed = (err) => {
|
const failed = (err) => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
console.log(err.to_string);
|
|
||||||
this.setState((prev, props) => ({
|
this.setState((prev, props) => ({
|
||||||
loaded_pages: prev.loaded_pages - 1,
|
loaded_pages: prev.loaded_pages - 1,
|
||||||
loading_status: 'failed',
|
loading_status: 'failed',
|
||||||
error_msg: prev.loaded_pages > 1 ? '找不到更多了' : '' + err,
|
error_msg: '' + err,
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1526,7 +1521,8 @@ class SubFlow extends PureComponent {
|
|||||||
},
|
},
|
||||||
loading_status: 'done',
|
loading_status: 'done',
|
||||||
}));
|
}));
|
||||||
});
|
})
|
||||||
|
.catch(failed);
|
||||||
} else {
|
} else {
|
||||||
console.log('local attention finished');
|
console.log('local attention finished');
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
export function get_json(res) {
|
export function get_json(res) {
|
||||||
if(!res.ok) {
|
if(!res.ok) {
|
||||||
console.log('error:', res);
|
return (
|
||||||
throw Error(`${res.status} ${res.statusText}`);
|
res.text().then((t) => {
|
||||||
|
console.log('error:', res);
|
||||||
|
t = t.length < 100 ? t : '';
|
||||||
|
throw Error(`${res.status} ${res.statusText} ${t}`);
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
res
|
res
|
||||||
|
|||||||
Reference in New Issue
Block a user