File tree Expand file tree Collapse file tree
meow/frontend/src/components/Posts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,26 @@ const NoPosts = () => (
2525) ;
2626
2727const displayStatus = postObject => {
28+ if ( postObject . sent_error ) {
29+ try {
30+ const error = postObject . sent_error_text ;
31+ let i = error . toLowerCase ( ) . indexOf ( "raise" ) ; // search for "raise", then "error"
32+ if ( i === - 1 ) {
33+ i = error . toLowerCase ( ) . indexOf ( "error" ) ;
34+ }
35+
36+ const DISPLAYED_ERROR_LENGTH = 150 ;
37+ if ( i >= 0 ) {
38+ if ( i + DISPLAYED_ERROR_LENGTH >= error . length ) {
39+ return error . substring ( error . length - DISPLAYED_ERROR_LENGTH ) ;
40+ }
41+ return error . substring ( i , i + DISPLAYED_ERROR_LENGTH ) ;
42+ }
43+ return error . substring ( 0 , DISPLAYED_ERROR_LENGTH ) ;
44+ } catch {
45+ return "Error" ;
46+ }
47+ }
2848 if ( postObject . sending ) {
2949 return "Sending" ;
3050 }
@@ -37,9 +57,6 @@ const displayStatus = postObject => {
3757 }
3858 return "Copy-Edited" ;
3959 }
40- if ( postObject . sent_error ) {
41- return "Error" ;
42- }
4360 return "Draft" ;
4461} ;
4562
Original file line number Diff line number Diff line change 3636}
3737
3838.ant-table-tbody .section ,
39- .ant-table-tbody .slug ,
40- .ant-table-tbody .status {
39+ .ant-table-tbody .slug {
4140 white-space : nowrap;
4241}
4342
You can’t perform that action at this time.
0 commit comments