mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 19:47:03 -04:00
Remove notification test
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
047b5e53c2
commit
328bc917eb
2 changed files with 0 additions and 38 deletions
|
@ -24,7 +24,6 @@ import { DualScrollState, ScrollState } from './synced-scroll/scroll-props'
|
||||||
import { RendererType } from '../render-page/window-post-message-communicator/rendering-message'
|
import { RendererType } from '../render-page/window-post-message-communicator/rendering-message'
|
||||||
import { useEditorModeFromUrl } from './hooks/useEditorModeFromUrl'
|
import { useEditorModeFromUrl } from './hooks/useEditorModeFromUrl'
|
||||||
import { UiNotifications } from '../notifications/ui-notifications'
|
import { UiNotifications } from '../notifications/ui-notifications'
|
||||||
import { useNotificationTest } from './use-notification-test'
|
|
||||||
import { useUpdateLocalHistoryEntry } from './hooks/useUpdateLocalHistoryEntry'
|
import { useUpdateLocalHistoryEntry } from './hooks/useUpdateLocalHistoryEntry'
|
||||||
import { useApplicationState } from '../../hooks/common/use-application-state'
|
import { useApplicationState } from '../../hooks/common/use-application-state'
|
||||||
import { EditorDocumentRenderer } from './editor-document-renderer/editor-document-renderer'
|
import { EditorDocumentRenderer } from './editor-document-renderer/editor-document-renderer'
|
||||||
|
@ -98,8 +97,6 @@ export const EditorPage: React.FC = () => {
|
||||||
log.debug('Make editor scroll source')
|
log.debug('Make editor scroll source')
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useNotificationTest()
|
|
||||||
|
|
||||||
const leftPane = useMemo(
|
const leftPane = useMemo(
|
||||||
() => (
|
() => (
|
||||||
<EditorPane
|
<EditorPane
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
/*
|
|
||||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { useEffect } from 'react'
|
|
||||||
import { dispatchUiNotification } from '../../redux/ui-notifications/methods'
|
|
||||||
import { Logger } from '../../utils/logger'
|
|
||||||
|
|
||||||
const localStorageKey = 'dontshowtestnotification'
|
|
||||||
const log = new Logger('Notification Test')
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Spawns a notification to test the system. Only for tech demo show case.
|
|
||||||
*/
|
|
||||||
export const useNotificationTest = (): void => {
|
|
||||||
useEffect(() => {
|
|
||||||
if (window.localStorage.getItem(localStorageKey)) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
log.debug('Dispatched test notification')
|
|
||||||
void dispatchUiNotification('notificationTest.title', 'notificationTest.content', {
|
|
||||||
icon: 'info-circle',
|
|
||||||
buttons: [
|
|
||||||
{
|
|
||||||
label: "Don't show again",
|
|
||||||
onClick: () => {
|
|
||||||
window.localStorage.setItem(localStorageKey, '1')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
})
|
|
||||||
}, [])
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue