Disable last dialog, fix markdown preview

This commit is contained in:
Piotr Rogowski 2022-01-24 00:19:00 +01:00
parent f608f722da
commit 1b1352df47
No known key found for this signature in database
GPG Key ID: 4A842D702D9C6F8F
2 changed files with 5 additions and 5 deletions

View File

@ -11,7 +11,6 @@ import { Config as ConfigType } from '@speedy-tuner/types';
import Dialog from '../components/Tune/Dialog';
import SideBar, { DialogMatchedPathType } from '../components/Tune/SideBar';
import { Routes } from '../routes';
import useBrowserStorage from '../hooks/useBrowserStorage';
import useConfig from '../hooks/useConfig';
import {
AppState,
@ -26,8 +25,8 @@ const mapStateToProps = (state: AppState) => ({
const Tune = ({ navigation, config }: { navigation: NavigationState, config: ConfigType }) => {
const { pathname } = useLocation();
const { storageGetSync } = useBrowserStorage();
const lastDialogPath = storageGetSync('lastDialog');
// const { storageGetSync } = useBrowserStorage();
// const lastDialogPath = storageGetSync('lastDialog');
const { isConfigReady } = useConfig(config);
const dialogMatchedPath: DialogMatchedPathType = useMemo(() => matchPath(pathname, {
path: Routes.TUNE_DIALOG,
@ -51,7 +50,7 @@ const Tune = ({ navigation, config }: { navigation: NavigationState, config: Con
return (
<>
<Route path={Routes.TUNE_TUNE} exact>
{firstDialogPath && <Redirect to={lastDialogPath || firstDialogPath} />}
{firstDialogPath && <Redirect to={firstDialogPath} />}
</Route>
<SideBar matchedPath={dialogMatchedPath} />
<Dialog

View File

@ -139,6 +139,7 @@ const UploadPage = () => {
const publish = async (values: any) => {
setIsLoading(true);
await updateData(newTuneId!, {
createdAt: new Date(),
updatedAt: new Date(),
isPublished: true,
isListed: values.isListed,
@ -585,7 +586,7 @@ const UploadPage = () => {
</Item>
</Tabs.TabPane>
<Tabs.TabPane tab="Preview" key="preview" style={{ height: descriptionEditorHeight }}>
<div className="markdown-preview" style={{ height: '100%' }}>
<div className="markdown-preview">
<ReactMarkdown>
{readme}
</ReactMarkdown>