mirror of
https://github.com/coracle-social/flotilla.git
synced 2025-12-09 18:37:02 +00:00
Lint
This commit is contained in:
@@ -47,7 +47,7 @@ export default [
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{args: "none", destructuredArrayIgnorePattern: "^_d?$"},
|
||||
{args: "none", destructuredArrayIgnorePattern: "^_d?$", caughtErrors: "none"},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import {derived, writable} from "svelte/store"
|
||||
import {derived} from "svelte/store"
|
||||
import {memoize, assoc} from "@welshman/lib"
|
||||
import type {CustomEvent} from "@welshman/util"
|
||||
import {Repository, createEvent, Relay} from "@welshman/util"
|
||||
import {withGetter} from "@welshman/store"
|
||||
import {NetworkContext, Tracker} from "@welshman/net"
|
||||
import type {ISigner} from "@welshman/signer"
|
||||
import {Nip46Broker, Nip46Signer, Nip07Signer, Nip01Signer} from "@welshman/signer"
|
||||
import {synced} from "@lib/util"
|
||||
import type {Session} from "@app/types"
|
||||
|
||||
@@ -1,17 +1,7 @@
|
||||
import {goto} from "$app/navigation"
|
||||
import {append, uniqBy, now} from "@welshman/lib"
|
||||
import {uniqBy, now} from "@welshman/lib"
|
||||
import {GROUPS, asDecryptedEvent, readList, editList, makeList, createList} from "@welshman/util"
|
||||
import {pushToast} from "@app/toast"
|
||||
import {pk, signer, repository, INDEXER_RELAYS} from "@app/base"
|
||||
import {
|
||||
splitGroupId,
|
||||
loadRelay,
|
||||
loadGroup,
|
||||
getWriteRelayUrls,
|
||||
loadRelaySelections,
|
||||
publish,
|
||||
ensurePlaintext,
|
||||
} from "@app/state"
|
||||
import {getWriteRelayUrls, loadRelaySelections, publish, ensurePlaintext} from "@app/state"
|
||||
|
||||
export type ModifyTags = (tags: string[][]) => string[][]
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
import {fly} from "@lib/transition"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Avatar from "@lib/components/Avatar.svelte"
|
||||
import {repository} from "@app/base"
|
||||
import {deriveProfile, deriveEvent} from "@app/state"
|
||||
|
||||
export let event: CustomEvent
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
<script lang="ts">
|
||||
import Link from "@lib/components/Link.svelte"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import {clip} from "@app/toast"
|
||||
</script>
|
||||
|
||||
<div class="column gap-4">
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
<script lang="ts">
|
||||
import {nip19} from "nostr-tools"
|
||||
import {makeSecret, Nip46Broker} from "@welshman/signer"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Field from "@lib/components/Field.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import Spinner from "@lib/components/Spinner.svelte"
|
||||
import CardButton from "@lib/components/CardButton.svelte"
|
||||
import InfoNostr from "@app/components/LogIn.svelte"
|
||||
import {pushModal, clearModal} from "@app/modal"
|
||||
import {pushToast} from "@app/toast"
|
||||
@@ -17,7 +15,6 @@
|
||||
const tryLogin = async () => {
|
||||
const secret = makeSecret()
|
||||
const handle = await loadHandle(`${username}@${handler.domain}`)
|
||||
console.log(handle)
|
||||
|
||||
if (!handle?.pubkey) {
|
||||
return pushToast({
|
||||
@@ -26,7 +23,7 @@
|
||||
})
|
||||
}
|
||||
|
||||
const {pubkey, relays = []} = handle
|
||||
const {pubkey} = handle
|
||||
const broker = Nip46Broker.get(pubkey, secret, handler)
|
||||
|
||||
if (await broker.connect()) {
|
||||
|
||||
@@ -7,25 +7,13 @@
|
||||
|
||||
<script lang="ts">
|
||||
import {page} from "$app/stores"
|
||||
import {goto} from "$app/navigation"
|
||||
import {derived} from "svelte/store"
|
||||
import {tweened} from "svelte/motion"
|
||||
import {quintOut} from "svelte/easing"
|
||||
import {identity, nth} from "@welshman/lib"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Avatar from "@lib/components/Avatar.svelte"
|
||||
import PrimaryNavItem from "@lib/components/PrimaryNavItem.svelte"
|
||||
import SpaceAdd from "@app/components/SpaceAdd.svelte"
|
||||
import {session} from "@app/base"
|
||||
import {
|
||||
userProfile,
|
||||
userGroupsByNom,
|
||||
makeGroupId,
|
||||
loadGroup,
|
||||
deriveProfile,
|
||||
qualifiedGroupsById,
|
||||
splitGroupId,
|
||||
} from "@app/state"
|
||||
import {userProfile, userGroupsByNom} from "@app/state"
|
||||
import {pushModal} from "@app/modal"
|
||||
import {getPrimaryNavItemIndex} from "@app/routes"
|
||||
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
<script lang="ts">
|
||||
import {goto} from "$app/navigation"
|
||||
import {append, uniqBy} from "@welshman/lib"
|
||||
import {GROUPS} from "@welshman/util"
|
||||
import CardButton from "@lib/components/CardButton.svelte"
|
||||
import Spinner from "@lib/components/Spinner.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import Field from "@lib/components/Field.svelte"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import SpaceCreateFinish from "@app/components/SpaceCreateFinish.svelte"
|
||||
import {pushModal} from "@app/modal"
|
||||
import {pushToast} from "@app/toast"
|
||||
import {GROUP_DELIMITER, splitGroupId, loadRelay, loadGroup, deriveGroup} from "@app/state"
|
||||
import {deriveGroup} from "@app/state"
|
||||
import {removeGroupMemberships} from "@app/commands"
|
||||
|
||||
export let nom
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
<script lang="ts">
|
||||
import {goto} from "$app/navigation"
|
||||
import {append, uniqBy} from "@welshman/lib"
|
||||
import {GROUPS} from "@welshman/util"
|
||||
import CardButton from "@lib/components/CardButton.svelte"
|
||||
import Spinner from "@lib/components/Spinner.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import Field from "@lib/components/Field.svelte"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import SpaceCreateFinish from "@app/components/SpaceCreateFinish.svelte"
|
||||
import {pushModal} from "@app/modal"
|
||||
import {pushToast} from "@app/toast"
|
||||
import {GROUP_DELIMITER, splitGroupId, loadRelay, loadGroup} from "@app/state"
|
||||
import {splitGroupId, loadRelay, loadGroup} from "@app/state"
|
||||
import {addGroupMemberships} from "@app/commands"
|
||||
|
||||
const back = () => history.back()
|
||||
|
||||
@@ -4,7 +4,6 @@ import {get, writable, readable, derived} from "svelte/store"
|
||||
import type {Maybe} from "@welshman/lib"
|
||||
import {
|
||||
max,
|
||||
uniq,
|
||||
between,
|
||||
uniqBy,
|
||||
groupBy,
|
||||
@@ -21,9 +20,7 @@ import {
|
||||
getIdFilters,
|
||||
getIdentifier,
|
||||
getRelayTags,
|
||||
getRelayTagValues,
|
||||
normalizeRelayUrl,
|
||||
getPubkeyTagValues,
|
||||
GROUP_META,
|
||||
PROFILE,
|
||||
RELAYS,
|
||||
@@ -34,34 +31,17 @@ import {
|
||||
readProfile,
|
||||
readList,
|
||||
asDecryptedEvent,
|
||||
editList,
|
||||
makeList,
|
||||
createList,
|
||||
GROUP_JOIN,
|
||||
GROUP_ADD_USER,
|
||||
} from "@welshman/util"
|
||||
import type {
|
||||
Filter,
|
||||
SignedEvent,
|
||||
CustomEvent,
|
||||
PublishedProfile,
|
||||
PublishedList,
|
||||
} from "@welshman/util"
|
||||
import type {SignedEvent, CustomEvent, PublishedProfile, PublishedList} from "@welshman/util"
|
||||
import type {SubscribeRequest, PublishRequest} from "@welshman/net"
|
||||
import {publish as basePublish, subscribe} from "@welshman/net"
|
||||
import {decrypt} from "@welshman/signer"
|
||||
import {deriveEvents, deriveEventsMapped, getter, withGetter} from "@welshman/store"
|
||||
import {parseJson, createSearch} from "@lib/util"
|
||||
import type {Session, Handle, Relay} from "@app/types"
|
||||
import {
|
||||
INDEXER_RELAYS,
|
||||
DUFFLEPUD_URL,
|
||||
repository,
|
||||
pk,
|
||||
getSession,
|
||||
getSigner,
|
||||
signer,
|
||||
} from "@app/base"
|
||||
import {createSearch} from "@lib/util"
|
||||
import type {Handle, Relay} from "@app/types"
|
||||
import {INDEXER_RELAYS, DUFFLEPUD_URL, repository, pk, getSession, getSigner} from "@app/base"
|
||||
|
||||
// Utils
|
||||
|
||||
|
||||
@@ -3,10 +3,8 @@ import type {IDBPDatabase} from "idb"
|
||||
import {throttle} from "throttle-debounce"
|
||||
import {writable} from "svelte/store"
|
||||
import type {Unsubscriber, Writable} from "svelte/store"
|
||||
import {isNil, randomInt} from "@welshman/lib"
|
||||
import {randomInt} from "@welshman/lib"
|
||||
import {withGetter} from "@welshman/store"
|
||||
import {getJson, setJson} from "@lib/util"
|
||||
import {pk, sessions, repository} from "@app/base"
|
||||
|
||||
export type Item = Record<string, any>
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {verifiedSymbol} from "nostr-tools"
|
||||
import type {Nip46Handler} from "@welshman/signer"
|
||||
import type {SignedEvent, TrustedEvent, RelayProfile} from "@welshman/util"
|
||||
import type {RelayProfile} from "@welshman/util"
|
||||
|
||||
export type Session = {
|
||||
method: string
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
</style>
|
||||
|
||||
<script lang="ts">
|
||||
import cx from "classnames"
|
||||
import {switcher} from "@welshman/lib"
|
||||
import AddSquare from "@assets/icons/Add Square.svg?dataurl"
|
||||
import AddCircle from "@assets/icons/Add Circle.svg?dataurl"
|
||||
|
||||
@@ -11,10 +11,8 @@
|
||||
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import {slide} from "svelte/transition"
|
||||
import {quintOut} from "svelte/easing"
|
||||
import {tweened} from "svelte/motion"
|
||||
import {last} from "@welshman/lib"
|
||||
|
||||
export let component
|
||||
export let props = {}
|
||||
|
||||
@@ -3,15 +3,14 @@
|
||||
import {onMount} from "svelte"
|
||||
import {page} from "$app/stores"
|
||||
import {createEventStore} from "@welshman/store"
|
||||
import {fly} from "@lib/transition"
|
||||
import ModalBox from "@lib/components/ModalBox.svelte"
|
||||
import Toast from "@app/components/Toast.svelte"
|
||||
import Landing from "@app/components/Landing.svelte"
|
||||
import PrimaryNav from "@app/components/PrimaryNav.svelte"
|
||||
import {modals, clearModal} from "@app/modal"
|
||||
import {theme} from "@app/theme"
|
||||
import {session, sessions, pk, repository} from "@app/base"
|
||||
import {plaintext, relays, handles} from "@app/state"
|
||||
import {session, repository} from "@app/base"
|
||||
import {relays, handles} from "@app/state"
|
||||
import {initStorage} from "@app/storage"
|
||||
|
||||
let ready: Promise<void>
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import Masonry from "svelte-bricks"
|
||||
import {append, remove} from "@welshman/lib"
|
||||
import {GROUP_META, displayRelayUrl} from "@welshman/util"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import {makeSpacePath} from "@app/routes"
|
||||
import {load, relays, groups, searchGroups, relayUrlsByNom, userMembership} from "@app/state"
|
||||
import {addGroupMemberships} from "@app/commands"
|
||||
import {load, relays, searchGroups, relayUrlsByNom, userMembership} from "@app/state"
|
||||
|
||||
const getRelayUrls = (nom: string): string[] => $relayUrlsByNom.get(nom) || []
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import {goto} from "$app/navigation"
|
||||
import {fly} from "@lib/transition"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Page from "@lib/components/Page.svelte"
|
||||
@@ -12,7 +11,6 @@
|
||||
import SpaceExit from "@app/components/SpaceExit.svelte"
|
||||
import {deriveGroup} from "@app/state"
|
||||
import {pushModal} from "@app/modal"
|
||||
import {removeGroupMemberships} from "@app/commands"
|
||||
|
||||
export let nom
|
||||
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
<script lang="ts">
|
||||
import {sleep, sortBy} from "@welshman/lib"
|
||||
import {sortBy} from "@welshman/lib"
|
||||
import type {CustomEvent} from "@welshman/util"
|
||||
import {page} from "$app/stores"
|
||||
import {fly} from "@lib/transition"
|
||||
import {formatTimestampAsDate} from "@lib/util"
|
||||
import Spinner from "@lib/components/Spinner.svelte"
|
||||
import Avatar from "@lib/components/Avatar.svelte"
|
||||
import GroupNote from "@app/components/GroupNote.svelte"
|
||||
import {deriveGroup, deriveGroupConversation} from "@app/state"
|
||||
import {deriveGroupConversation} from "@app/state"
|
||||
|
||||
$: group = deriveGroup($page.params.nom)
|
||||
$: conversation = deriveGroupConversation($page.params.nom)
|
||||
|
||||
const assertEvent = (e: any) => e as CustomEvent
|
||||
@@ -31,7 +28,7 @@
|
||||
let previousPubkey
|
||||
|
||||
for (const {event} of sortBy(m => m.event.created_at, $conversation?.messages || [])) {
|
||||
const {id, kind, pubkey, created_at} = event
|
||||
const {id, pubkey, created_at} = event
|
||||
const date = formatTimestampAsDate(created_at)
|
||||
|
||||
if (date !== previousDate) {
|
||||
|
||||
Reference in New Issue
Block a user