prettier: format project
This commit is contained in:
94 files changed
+261
-252
No files matched your search
@@ -78,7 +78,7 @@
|
||||
class="relative w-max"
|
||||
bind:value={
|
||||
() => data.unreadOnly.value.toString(),
|
||||
v => (data.unreadOnly.value = v == 'true')
|
||||
(v) => (data.unreadOnly.value = v == 'true')
|
||||
}
|
||||
onchange={() =>
|
||||
searchParam(
|
||||
@@ -121,7 +121,7 @@
|
||||
!data.inbox || (data.inbox.value?.length ?? 0) < (data?.limit ?? 0)
|
||||
)}
|
||||
page={data.page}
|
||||
href={page => `?page=${page}`}
|
||||
href={(page) => `?page=${page}`}
|
||||
/>
|
||||
</Fixate>
|
||||
{/if}
|
||||
@@ -61,10 +61,10 @@ export async function load({ url, fetch }) {
|
||||
|
||||
const totalNotifs =
|
||||
type == 'all'
|
||||
? data.filter(i => i.type != 'private_message' && !i.read).length
|
||||
? data.filter((i) => i.type != 'private_message' && !i.read).length
|
||||
: 0
|
||||
|
||||
notifications.update(i => ({
|
||||
notifications.update((i) => ({
|
||||
applications: i.applications,
|
||||
reports: i.reports,
|
||||
inbox: totalNotifs,
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
color={item.read ? 'secondary' : 'primary'}
|
||||
{loading}
|
||||
disabled={loading}
|
||||
onclick={e => {
|
||||
onclick={(e) => {
|
||||
e.stopPropagation()
|
||||
markAsRead(!item.read)
|
||||
}}
|
||||
@@ -132,7 +132,7 @@
|
||||
color={item.read ? 'secondary' : 'primary'}
|
||||
{loading}
|
||||
disabled={loading}
|
||||
onclick={e => {
|
||||
onclick={(e) => {
|
||||
e.stopPropagation()
|
||||
markAsRead(!item.read)
|
||||
}}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
function filterDuplicates<T, K>(array: T[], predicate: (item: T) => K): T[] {
|
||||
const seen = new SvelteSet()
|
||||
return array.filter(element => {
|
||||
return array.filter((element) => {
|
||||
const value = predicate(element)
|
||||
if (seen.has(value)) {
|
||||
return false
|
||||
@@ -50,13 +50,13 @@
|
||||
function conversationPreviews(
|
||||
conversations: PrivateMessageView[],
|
||||
): ConversationPreview[] {
|
||||
const deduplicated = filterDuplicates(conversations, i =>
|
||||
const deduplicated = filterDuplicates(conversations, (i) =>
|
||||
getOtherPartyId(i),
|
||||
)
|
||||
|
||||
return deduplicated
|
||||
.filter(c => c.creator.id != c.recipient.id) // you messaged yourself
|
||||
.map(i => ({
|
||||
.filter((c) => c.creator.id != c.recipient.id) // you messaged yourself
|
||||
.map((i) => ({
|
||||
user:
|
||||
i.creator.id != profile.current.user?.local_user_view.person.id
|
||||
? i.creator
|
||||
@@ -81,7 +81,7 @@
|
||||
<UserAutocomplete
|
||||
listing_type="All"
|
||||
hideOwnUser={true}
|
||||
onselect={u =>
|
||||
onselect={(u) =>
|
||||
goto(
|
||||
resolveRoute('/inbox/messages/[user_id]', { user_id: u.id.toString() }),
|
||||
)}
|
||||
@@ -164,7 +164,7 @@
|
||||
<Pageination
|
||||
page={data.page}
|
||||
hasMore={res.private_messages.length == 50}
|
||||
href={current => `/inbox/messages?page=${current}`}
|
||||
href={(current) => `/inbox/messages?page=${current}`}
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
data.message.value = {
|
||||
private_messages: data.message.value.private_messages.toSpliced(
|
||||
data.message.value.private_messages.findLastIndex(
|
||||
i => i.private_message.id == id,
|
||||
(i) => i.private_message.id == id,
|
||||
),
|
||||
1,
|
||||
),
|
||||
@@ -182,7 +182,7 @@
|
||||
? 'flex flex-col'
|
||||
: 'flex-row h-14 items-center',
|
||||
]}
|
||||
onsubmit={async e => {
|
||||
onsubmit={async (e) => {
|
||||
e.preventDefault()
|
||||
|
||||
const res = await sendMessage(textbox.message)
|
||||
|
||||
Reference in new issue
Block a user