Clear announcement history using window.clearLastViewedAnnouncement()
This helps testing, and can be eventually removed. No harm leaving it there, though.
This commit is contained in:
parent
d70f0f1d6d
commit
14a11aa78a
2 changed files with 11 additions and 0 deletions
|
@ -7,6 +7,7 @@ import {
|
|||
selectSyncIsLocked,
|
||||
} from 'redux/selectors/sync';
|
||||
import { doUserSetReferrer } from 'redux/actions/user';
|
||||
import { doSetLastViewedAnnouncement } from 'redux/actions/content';
|
||||
import {
|
||||
selectOdyseeMembershipIsPremiumPlus,
|
||||
selectUser,
|
||||
|
@ -58,6 +59,7 @@ const perform = {
|
|||
fetchModBlockedList: doFetchModBlockedList,
|
||||
fetchModAmIList: doFetchCommentModAmIList,
|
||||
doOpenAnnouncements,
|
||||
doSetLastViewedAnnouncement,
|
||||
};
|
||||
|
||||
export default hot(connect(select, perform)(App));
|
||||
|
|
|
@ -89,6 +89,7 @@ type Props = {
|
|||
fetchModAmIList: () => void,
|
||||
homepageFetched: boolean,
|
||||
doOpenAnnouncements: () => void,
|
||||
doSetLastViewedAnnouncement: (hash: string) => void,
|
||||
};
|
||||
|
||||
function App(props: Props) {
|
||||
|
@ -123,6 +124,7 @@ function App(props: Props) {
|
|||
fetchModAmIList,
|
||||
homepageFetched,
|
||||
doOpenAnnouncements,
|
||||
doSetLastViewedAnnouncement,
|
||||
} = props;
|
||||
|
||||
const isMobile = useIsMobile();
|
||||
|
@ -481,6 +483,13 @@ function App(props: Props) {
|
|||
}
|
||||
}, [prefsReady]);
|
||||
|
||||
useEffect(() => {
|
||||
window.clearLastViewedAnnouncement = () => {
|
||||
console.log('Clearing history. Please wait ...');
|
||||
doSetLastViewedAnnouncement('');
|
||||
};
|
||||
}, []);
|
||||
|
||||
// Keep this at the end to ensure initial setup effects are run first
|
||||
useEffect(() => {
|
||||
if (!hasSignedIn && hasVerifiedEmail) {
|
||||
|
|
Loading…
Reference in a new issue