@@ -139,6 +139,8 @@ import { isLocalRoom } from '../../utils/localRoom/isLocalRoom';
139
139
import { SdkContextClass , SDKContext } from '../../contexts/SDKContext' ;
140
140
import { viewUserDeviceSettings } from '../../actions/handlers/viewUserDeviceSettings' ;
141
141
import { VoiceBroadcastResumer } from '../../voice-broadcast' ;
142
+ import GenericToast from "../views/toasts/GenericToast" ;
143
+ import { Linkify } from "../views/elements/Linkify" ;
142
144
143
145
// legacy export
144
146
export { default as Views } from "../../Views" ;
@@ -1332,6 +1334,28 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
1332
1334
// check if it has been dismissed before, etc.
1333
1335
showMobileGuideToast ( ) ;
1334
1336
}
1337
+
1338
+ const userNotice = SdkConfig . get ( "user_notice" ) ;
1339
+ if ( userNotice ) {
1340
+ const key = "user_notice_" + userNotice . title ;
1341
+ if ( ! userNotice . show_once || ! localStorage . getItem ( key ) ) {
1342
+ ToastStore . sharedInstance ( ) . addOrReplaceToast ( {
1343
+ key,
1344
+ title : userNotice . title ,
1345
+ props : {
1346
+ description : < Linkify > { userNotice . description } </ Linkify > ,
1347
+ acceptLabel : _t ( "OK" ) ,
1348
+ onAccept : ( ) => {
1349
+ ToastStore . sharedInstance ( ) . dismissToast ( key ) ;
1350
+ localStorage . setItem ( key , "1" ) ;
1351
+ } ,
1352
+ } ,
1353
+ component : GenericToast ,
1354
+ className : "mx_AnalyticsToast" ,
1355
+ priority : 100 ,
1356
+ } ) ;
1357
+ }
1358
+ }
1335
1359
}
1336
1360
1337
1361
private initPosthogAnalyticsToast ( ) {
0 commit comments