mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
style: format via prettier
This commit is contained in:
@@ -41,7 +41,10 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="sticky top-0 left-0 z-100 h-15 w-full border-b border-neutral-800 bg-neutral-900 shadow-md" id="navbar">
|
<div
|
||||||
|
class="sticky top-0 left-0 z-100 h-15 w-full border-b border-neutral-800 bg-neutral-900 shadow-md"
|
||||||
|
id="navbar"
|
||||||
|
>
|
||||||
<div class="mx-auto hidden h-15 w-[95%] max-w-7xl items-center py-2 md:flex">
|
<div class="mx-auto hidden h-15 w-[95%] max-w-7xl items-center py-2 md:flex">
|
||||||
<div class="flex items-center gap-6">
|
<div class="flex items-center gap-6">
|
||||||
<a href={resolve('/')} class="group flex items-center gap-2">
|
<a href={resolve('/')} class="group flex items-center gap-2">
|
||||||
@@ -52,7 +55,7 @@
|
|||||||
<a
|
<a
|
||||||
href={resolve('/recent')}
|
href={resolve('/recent')}
|
||||||
class="relative text-neutral-300 after:absolute after:-bottom-0.5 after:left-0 after:h-px after:w-0 after:bg-white after:transition-all hover:text-white hover:after:w-full"
|
class="relative text-neutral-300 after:absolute after:-bottom-0.5 after:left-0 after:h-px after:w-0 after:bg-white after:transition-all hover:text-white hover:after:w-full"
|
||||||
>Recent Pastes</a
|
>Recent Pastes</a
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
{#if $user}
|
{#if $user}
|
||||||
@@ -60,12 +63,14 @@
|
|||||||
{#if hasRole($user.roles, 2) || hasRole($user.roles, 4)}
|
{#if hasRole($user.roles, 2) || hasRole($user.roles, 4)}
|
||||||
<a
|
<a
|
||||||
href={resolve('/reports')}
|
href={resolve('/reports')}
|
||||||
class="rounded bg-neutral-700 px-3 py-1 text-white transition-colors hover:bg-neutral-600">Reports</a
|
class="rounded bg-neutral-700 px-3 py-1 text-white transition-colors hover:bg-neutral-600"
|
||||||
|
>Reports</a
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
<a
|
<a
|
||||||
href={resolve(`/user/${$user.username}`)}
|
href={resolve(`/user/${$user.username}`)}
|
||||||
class="rounded bg-neutral-700 px-3 py-1 text-white transition-colors hover:bg-neutral-600">Profile</a
|
class="rounded bg-neutral-700 px-3 py-1 text-white transition-colors hover:bg-neutral-600"
|
||||||
|
>Profile</a
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
on:click={logout}
|
on:click={logout}
|
||||||
@@ -77,13 +82,14 @@
|
|||||||
<div class="ml-auto flex items-center space-x-4">
|
<div class="ml-auto flex items-center space-x-4">
|
||||||
<a
|
<a
|
||||||
href={resolve(`/login${returnParam}`)}
|
href={resolve(`/login${returnParam}`)}
|
||||||
class="rounded bg-neutral-700 px-3 py-1 text-white transition-colors hover:bg-neutral-600">Login</a
|
class="rounded bg-neutral-700 px-3 py-1 text-white transition-colors hover:bg-neutral-600"
|
||||||
|
>Login</a
|
||||||
>
|
>
|
||||||
<!-- eslint-disable svelte/no-navigation-without-resolve -->
|
<!-- eslint-disable svelte/no-navigation-without-resolve -->
|
||||||
<a
|
<a
|
||||||
href={data.options?.registration_enabled ? resolve(`/register${returnParam}`) : '#'}
|
href={data.options?.registration_enabled ? resolve(`/register${returnParam}`) : '#'}
|
||||||
class="rounded bg-neutral-700 px-3 py-1 text-white transition-colors hover:bg-neutral-600 {data.options
|
class="rounded bg-neutral-700 px-3 py-1 text-white transition-colors hover:bg-neutral-600 {data
|
||||||
?.registration_enabled
|
.options?.registration_enabled
|
||||||
? ''
|
? ''
|
||||||
: 'cursor-not-allowed bg-neutral-800 text-neutral-500!'}">Register</a
|
: 'cursor-not-allowed bg-neutral-800 text-neutral-500!'}">Register</a
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -97,11 +97,14 @@ async function deleteCacheEntry(id: string, relativePath?: string): Promise<void
|
|||||||
const db = getDatabase();
|
const db = getDatabase();
|
||||||
const resolvedPath =
|
const resolvedPath =
|
||||||
relativePath ??
|
relativePath ??
|
||||||
((db
|
(
|
||||||
.prepare('SELECT relative_path AS relativePath FROM og_image_cache WHERE paste_id = ?')
|
db
|
||||||
.get(id) as { relativePath: string } | undefined)?.relativePath ?? null);
|
.prepare('SELECT relative_path AS relativePath FROM og_image_cache WHERE paste_id = ?')
|
||||||
|
.get(id) as { relativePath: string } | undefined
|
||||||
|
)?.relativePath ??
|
||||||
|
null;
|
||||||
|
|
||||||
db.prepare('DELETE FROM og_image_cache WHERE paste_id = ?').run(id);
|
db.prepare('DELETE FROM og_image_cache WHERE paste_id = ?').run(id);
|
||||||
if (resolvedPath) {
|
if (resolvedPath) {
|
||||||
await deleteCacheFile(resolvedPath);
|
await deleteCacheFile(resolvedPath);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user