mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-29 08:21:20 +00:00
Fix some bugs
This commit is contained in:
parent
8bbe09b4b1
commit
d7b45b1d99
@ -245,8 +245,12 @@
|
||||
},
|
||||
})
|
||||
|
||||
router.register("/notifications", Notifications)
|
||||
router.register("/notifications/:activeTab", Notifications)
|
||||
router.register("/notifications", Notifications, {
|
||||
requireUser: true,
|
||||
})
|
||||
router.register("/notifications/:activeTab", Notifications, {
|
||||
requireUser: true,
|
||||
})
|
||||
|
||||
router.register("/onboarding", Onboarding)
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
<script lang="ts">
|
||||
import Fuse from "fuse.js"
|
||||
import {tryFunc} from "hurdak"
|
||||
import {fromNostrURI} from "paravel"
|
||||
import {throttle} from "throttle-debounce"
|
||||
import {nip05, nip19} from "nostr-tools"
|
||||
import {fuzzy} from "src/util/misc"
|
||||
import {isHex} from "src/util/nostr"
|
||||
import {router} from "src/app/router"
|
||||
import type {Person, Topic} from "src/engine"
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
const searchTopics = topics
|
||||
.throttle(1000)
|
||||
.derived($topics => new Fuse($topics, {keys: ["name"], threshold: 0.5, shouldSort: true}))
|
||||
.derived($topics => fuzzy($topics, {keys: ["name"], threshold: 0.5, shouldSort: true}))
|
||||
|
||||
const results = derived<{type: string; id: string; person?: Person; topic?: Topic}[]>(
|
||||
[term, searchTopics, searchPeople],
|
||||
@ -76,7 +76,11 @@
|
||||
},
|
||||
)
|
||||
|
||||
$: loadPeople($term)
|
||||
$: {
|
||||
if ($term) {
|
||||
loadPeople($term)
|
||||
}
|
||||
}
|
||||
|
||||
primeWotCaches($pubkey)
|
||||
</script>
|
||||
|
@ -15,7 +15,7 @@ export const getGroupNaddr = (group: Group) =>
|
||||
|
||||
export const getGroupId = (group: Group) => group.address.split(":").slice(2).join(":")
|
||||
|
||||
export const getGroupName = (group: Group) => group.meta?.name || group.id
|
||||
export const getGroupName = (group: Group) => group.meta?.name || group.id || ""
|
||||
|
||||
export const displayGroup = (group: Group) => ellipsize(group ? getGroupName(group) : "No name", 60)
|
||||
|
||||
|
@ -5,7 +5,7 @@ import {topics} from "./state"
|
||||
|
||||
export const addTopic = (e, name) => {
|
||||
if (name) {
|
||||
const topic = topics.key(name)
|
||||
const topic = topics.key(name.toLowerCase())
|
||||
|
||||
topic.merge({
|
||||
count: inc(topic.get()?.count || 0),
|
||||
|
@ -384,7 +384,7 @@ export class Router {
|
||||
$history.splice(0, 1)
|
||||
}
|
||||
|
||||
globalHistory.navigate($history[0].path)
|
||||
globalHistory.navigate($history[0]?.path || "/")
|
||||
|
||||
return $history
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user