feat: switch to a string instead of enum

This commit is contained in:
Xyphyn committed 2023-08-02 14:22:27 -07:00
1 parent aeb727ae3b
commit 87612d6507
23 files changed
+92 -128

No files matched your search

+2 -2
View File
@@ -7,7 +7,7 @@
import { userSettings } from '$lib/settings.js'
import PostLink from '$lib/components/lemmy/post/PostLink.svelte'
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import Markdown from '$lib/components/markdown/Markdown.svelte'
export let post: PostView
@@ -125,7 +125,7 @@
post.post.url = e.detail.post.url
toast({
content: 'The post was edited successfully.',
type: ToastType.success,
type: 'success',
})
}}
/>
@@ -20,7 +20,7 @@
import Button from '$lib/components/input/Button.svelte'
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
import { page } from '$app/stores'
import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { createEventDispatcher } from 'svelte'
import Modal from '$lib/components/ui/modal/Modal.svelte'
import PostForm from '$lib/components/lemmy/post/PostForm.svelte'
@@ -44,12 +44,12 @@
post.post.deleted = !deleted
toast({
content: `That post was ${deleted ? 'restored' : 'deleted'}.`,
type: ToastType.success,
type: 'success',
})
} catch (err) {
toast({
content: err as any,
type: ToastType.error,
type: 'error',
})
}
}
@@ -72,7 +72,7 @@
toast({
content: error as any,
type: ToastType.error,
type: 'error',
})
}
}
@@ -6,7 +6,7 @@
import TextArea from '$lib/components/input/TextArea.svelte'
import FileInput from '$lib/components/input/FileInput.svelte'
import Button from '$lib/components/input/Button.svelte'
import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import SearchInput from '$lib/components/input/SearchInput.svelte'
import { Check, Icon } from 'svelte-hero-icons'
import { profile } from '$lib/auth.js'
@@ -77,7 +77,7 @@
async function submit() {
if (!data.community && !edit) {
toast({
type: ToastType.warning,
type: 'warning',
content: 'You need to set a community.',
})
return
@@ -123,7 +123,7 @@
dispatcher('submit', post.post_view)
}
} catch (err) {
toast({ content: err as any, type: ToastType.error })
toast({ content: err as any, type: 'error' })
}
}