mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24:16 +00:00
use FeedModel
model
This commit is contained in:
parent
59f901334b
commit
871ad08925
@ -5,6 +5,8 @@ import classnames from "classnames"
|
|||||||
import { UserPreview } from "components"
|
import { UserPreview } from "components"
|
||||||
import { Icons, createIconRender } from "components/Icons"
|
import { Icons, createIconRender } from "components/Icons"
|
||||||
|
|
||||||
|
import FeedModel from "models/feed"
|
||||||
|
|
||||||
import "./index.less"
|
import "./index.less"
|
||||||
|
|
||||||
const ResultRenders = {
|
const ResultRenders = {
|
||||||
@ -88,7 +90,7 @@ export default (props) => {
|
|||||||
return setSearchResult(null)
|
return setSearchResult(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await app.searchEngine.search(value)
|
const result = await FeedModel.search(value)
|
||||||
|
|
||||||
return setSearchResult(result)
|
return setSearchResult(result)
|
||||||
}
|
}
|
||||||
@ -105,11 +107,11 @@ export default (props) => {
|
|||||||
const handleResultClick = (type, value) => {
|
const handleResultClick = (type, value) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "users": {
|
case "users": {
|
||||||
app.goToAccount(value.username)
|
app.navigation.goToAccount(value.username)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case "posts": {
|
case "posts": {
|
||||||
app.goToPost(value)
|
app.navigation.goToPost(value)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user