improve: Move notifications from redux into context

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-08-18 23:07:23 +02:00
parent b797f07aa5
commit 03d87f59f8
38 changed files with 362 additions and 376 deletions

View file

@ -1,17 +1,17 @@
/*
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
SPDX-License-Identifier: AGPL-3.0-only
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import React, { useEffect } from 'react'
import type { NextPage } from 'next'
import { Trans, useTranslation } from 'react-i18next'
import { HistoryToolbar } from '../components/history-page/history-toolbar/history-toolbar'
import { safeRefreshHistoryState } from '../redux/history/methods'
import { Row } from 'react-bootstrap'
import { HistoryContent } from '../components/history-page/history-content/history-content'
import { LandingLayout } from '../components/landing-layout/landing-layout'
import { HistoryToolbarStateContextProvider } from '../components/history-page/history-toolbar/toolbar-context/history-toolbar-state-context-provider'
import { useSafeRefreshHistoryStateCallback } from '../components/history-page/history-toolbar/hooks/use-safe-refresh-history-state'
/**
* The page that shows the local and remote note history.
@ -19,9 +19,10 @@ import { HistoryToolbarStateContextProvider } from '../components/history-page/h
const HistoryPage: NextPage = () => {
useTranslation()
const safeRefreshHistoryStateCallback = useSafeRefreshHistoryStateCallback()
useEffect(() => {
safeRefreshHistoryState()
}, [])
safeRefreshHistoryStateCallback()
}, [safeRefreshHistoryStateCallback])
return (
<LandingLayout>