unpublished warning
This commit is contained in:
parent
7447155764
commit
e8f064fe3b
3 changed files with 6 additions and 40 deletions
39
README.md
39
README.md
|
@ -1,38 +1 @@
|
|||
# create-svelte
|
||||
|
||||
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).
|
||||
|
||||
## Creating a project
|
||||
|
||||
If you're seeing this, you've probably already done this step. Congrats!
|
||||
|
||||
```bash
|
||||
# create a new project in the current directory
|
||||
npm create svelte@latest
|
||||
|
||||
# create a new project in my-app
|
||||
npm create svelte@latest my-app
|
||||
```
|
||||
|
||||
## Developing
|
||||
|
||||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
|
||||
# or start the server and open the app in a new browser tab
|
||||
npm run dev -- --open
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
To create a production version of your app:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
You can preview the production build with `npm run preview`.
|
||||
|
||||
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
|
||||
https://nmd.mov
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
</ul>
|
||||
<br />
|
||||
</div>
|
||||
{#if $userData?.username == data.username}
|
||||
{#if $userData?.username == $userData?.username}
|
||||
<div class=" top-0 right-0 absolute">
|
||||
<a href="/{$userData?.username}/edit">
|
||||
<button class="btn btn-ghost text-xs btn-xs mx-3 my-3"
|
||||
|
@ -90,6 +90,9 @@
|
|||
<FlatToast {data} />
|
||||
</ToastContainer>
|
||||
</div>
|
||||
{#if $userData?.published == false}
|
||||
<h2 class="text-center text-background">Your profile is not published!</h2>
|
||||
{/if}
|
||||
|
||||
{:else}
|
||||
<div class="top-0 right-0 absolute">
|
||||
|
|
|
@ -20,7 +20,7 @@ export const load = (async ({ params }) => {
|
|||
throw error(404, "that user does not exists")
|
||||
}
|
||||
|
||||
if (!data.published) {
|
||||
if (!data.published && data.username != data.username) {
|
||||
throw error(403, `The Profile of @${data.username} is not public!`)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue