Added flag on short URL creation which tells if the short URL was already saved

This commit is contained in:
Alejandro Celaya
2022-11-07 18:24:26 +01:00
parent ae1d39bede
commit 4ca31fc162
9 changed files with 23 additions and 19 deletions

View File

@@ -12,7 +12,7 @@ export interface CreateShortUrlProps {
interface CreateShortUrlConnectProps extends CreateShortUrlProps {
settings: Settings;
shortUrlCreationResult: ShortUrlCreation;
shortUrlCreation: ShortUrlCreation;
selectedServer: SelectedServer;
createShortUrl: (data: ShortUrlData) => Promise<void>;
resetCreateShortUrl: () => void;
@@ -38,7 +38,7 @@ export const CreateShortUrl = (
CreateShortUrlResult: FC<CreateShortUrlResultProps>,
) => ({
createShortUrl,
shortUrlCreationResult,
shortUrlCreation,
resetCreateShortUrl,
selectedServer,
basicMode = false,
@@ -50,7 +50,7 @@ export const CreateShortUrl = (
<>
<ShortUrlForm
initialState={initialState}
saving={shortUrlCreationResult.saving}
saving={shortUrlCreation.saving}
selectedServer={selectedServer}
mode={basicMode ? 'create-basic' : 'create'}
onSave={async (data: ShortUrlData) => {
@@ -59,7 +59,7 @@ export const CreateShortUrl = (
}}
/>
<CreateShortUrlResult
{...shortUrlCreationResult}
{...shortUrlCreation}
resetCreateShortUrl={resetCreateShortUrl}
canBeClosed={basicMode}
/>