diff --git a/src/App.js b/src/App.js
index 2274dc8e..67e96b7f 100644
--- a/src/App.js
+++ b/src/App.js
@@ -22,6 +22,7 @@ class App extends Component {
load_config();
load_attentions();
window.AS_BACKUP = localStorage['DEFAULT_ALLOW_SEARCH'] ? true : false;
+ window.LAST_ANN = localStorage['LAST_ANN'];
listen_darkmode(
{ default: undefined, light: false, dark: true }[
window.config.color_scheme
diff --git a/src/Flows.css b/src/Flows.css
index 84fdb2f1..9d827518 100644
--- a/src/Flows.css
+++ b/src/Flows.css
@@ -388,3 +388,7 @@
.root-dark-mode .box-poll .styles_votes__3IO-o {
color: #e0e0e0 !important;
}
+
+.announcement-header {
+ text-align: right;
+}
diff --git a/src/Flows.js b/src/Flows.js
index 48d8040d..f482dad2 100644
--- a/src/Flows.js
+++ b/src/Flows.js
@@ -1283,6 +1283,38 @@ function FlowChunk(props) {
);
}
+function Announcement(props) {
+ const [show, setShow] = useState(true);
+ function do_close() {
+ window.LAST_ANN = props.text;
+ localStorage['LAST_ANN'] = props.text;
+ setShow(false);
+ }
+ return (
+ show && (
+
+ )
+ );
+}
+
export class Flow extends PureComponent {
constructor(props) {
super(props);
@@ -1357,6 +1389,7 @@ class SubFlow extends PureComponent {
title: '',
data: [],
},
+ announcement: null,
local_attention_text: null,
loading_status: 'done',
error_msg: null,
@@ -1418,6 +1451,7 @@ class SubFlow extends PureComponent {
),
),
},
+ announcement: json.announcement,
loading_status: 'done',
}));
})
@@ -1597,11 +1631,14 @@ class SubFlow extends PureComponent {
render() {
const should_deletion_detect = localStorage['DELETION_DETECT'] === 'on';
- const { mode, chunks, local_attention_text, search_param } = this.state;
+ const { mode, chunks, local_attention_text, search_param, announcement } =
+ this.state;
+ const { submode, show_sidebar, token } = this.props;
+ console.log(announcement);
return (
{mode === 'attention' &&
- this.props.submode === 1 &&
+ submode === 1 &&
local_attention_text === null && (
)}
+ {mode === 'list' &&
+ announcement &&
+ window.LAST_ANN !== announcement && (
+
+ )}
+
{this.state.loading_status === 'failed' && (