mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-30 00:41:12 +00:00
Make search work event when relays don't support it
This commit is contained in:
parent
f501eb1c29
commit
d3a39facde
@ -1,7 +1,7 @@
|
||||
# Current
|
||||
|
||||
- [ ] Enable global view via env var
|
||||
- [ ] Ask for name/image, first post on signup
|
||||
- [ ] Fix cursor
|
||||
- [ ] Add coupon code registration for relay
|
||||
- [ ] Image classification
|
||||
- https://github.com/bhky/opennsfw2
|
||||
|
||||
|
@ -7,8 +7,6 @@ export const defaultFollows = (import.meta.env.VITE_DEFAULT_FOLLOWS || "")
|
||||
.split(",")
|
||||
.filter(identity)
|
||||
|
||||
console.log(defaultFollows)
|
||||
|
||||
export const getFollows = pubkey =>
|
||||
Tags.wrap(getPersonWithFallback(pubkey).petnames).type("p").values().all()
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
import Content from "src/partials/Content.svelte"
|
||||
import BorderLeft from "src/partials/BorderLeft.svelte"
|
||||
import PersonInfo from "src/app/shared/PersonInfo.svelte"
|
||||
import {sampleRelays} from "src/agent/relays"
|
||||
import {sampleRelays, getUserReadRelays} from "src/agent/relays"
|
||||
import network from "src/agent/network"
|
||||
import {watch} from "src/agent/db"
|
||||
import user from "src/agent/user"
|
||||
@ -20,11 +20,18 @@
|
||||
}
|
||||
|
||||
const loadPeople = debounce(500, search => {
|
||||
// If we have a query, search using nostr.band. If not, ask for random profiles.
|
||||
// This allows us to populate results even if search isn't supported by forced urls
|
||||
if (q.length > 2) {
|
||||
network.load({
|
||||
relays: sampleRelays([{url: "wss://relay.nostr.band"}]),
|
||||
filter: [{kinds: [0], search, limit: 10}],
|
||||
})
|
||||
} else {
|
||||
network.load({
|
||||
relays: getUserReadRelays(),
|
||||
filter: [{kinds: [0], limit: 50}],
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -101,11 +101,8 @@ export const theme = synced("ui/theme", prefersDark ? "dark" : "light")
|
||||
|
||||
export const getThemeColors = $theme => {
|
||||
for (const x of range(1, 10)) {
|
||||
// const lum = $theme === 'dark' ? (x - 5) * 30 : (4 - x) * 30
|
||||
const lum = $theme === "dark" ? (5 - x) * 25 : (x - 5) * 25
|
||||
|
||||
console.log(lum, shadeColor(THEME[`gray-${$theme}`], lum))
|
||||
|
||||
THEME[`gray-${x}`] = shadeColor(THEME[`gray-${$theme}`], lum)
|
||||
}
|
||||
|
||||
|
@ -6,8 +6,6 @@ import sveltePreprocess from "svelte-preprocess"
|
||||
import {svelte} from "@sveltejs/vite-plugin-svelte"
|
||||
import {nodePolyfills} from "vite-plugin-node-polyfills"
|
||||
|
||||
console.log(process.env.VITE_APP_NAME)
|
||||
|
||||
export default defineConfig({
|
||||
server: {
|
||||
https: false,
|
||||
|
Loading…
Reference in New Issue
Block a user