Skip to content

Commit 27b4e34

Browse files
committed
Fix search
1 parent de79f03 commit 27b4e34

5 files changed

Lines changed: 6 additions & 43 deletions

File tree

src/components/Header.tsx

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -172,43 +172,6 @@ function HeaderLink({ state }: HeaderProps) {
172172
)
173173
}
174174

175-
// function UserDropdownItems({ state, actions }: HeaderProps) {
176-
// const user = state.users.user
177-
// if (user && !user.anonymous) {
178-
// return (
179-
// <DropdownItem
180-
// text="Sign Out"
181-
// class="show-sm"
182-
// onclick={actions.users.signOut}
183-
// />
184-
// )
185-
// }
186-
// const log = actions.logger.log
187-
// return [
188-
// <DropdownItem divider text="User" />,
189-
// <DropdownItem
190-
// text="Sign Up"
191-
// class="show-sm"
192-
// onclick={actions.users.showSignUpModal}
193-
// />,
194-
// <DropdownItem
195-
// text="Email Sign In"
196-
// class="show-sm"
197-
// onclick={actions.users.showSignInModal}
198-
// />,
199-
// <DropdownItem
200-
// text="Sign In Google"
201-
// class="show-sm"
202-
// onclick={() => log(actions.users.signInWithGoogle)}
203-
// />,
204-
// <DropdownItem
205-
// text="Sign In Github"
206-
// class="show-sm"
207-
// onclick={() => log(actions.users.signInWithGithub)}
208-
// />
209-
// ]
210-
// }
211-
212175
function ActionsButton(props: HeaderProps) {
213176
const { state, actions } = props
214177
if (state.editor.status === "closed") {

src/lib/search/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * from "./api"
22
export * from "./ProjectsSearch"
3+
export * from "./utils"

src/module.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import { createSearch } from "lib/search/module"
1212
import { ui } from "ui/module"
1313
import { users } from "users/module"
1414
import { AuthListener } from "users"
15-
import { COLLECTION, ProjectOwner } from "projects"
16-
import { getWords } from "lib/search"
15+
import { COLLECTION, ProjectOwner, ProjectDetails } from "projects"
16+
import { getWords, SearchFn } from "lib/search"
1717
import { getProjectsStore } from "getProjectsStore"
1818
import { createProject } from "./createProject"
1919
import { logConfig, logEvent } from "analytics"
@@ -62,12 +62,12 @@ export const module: ModuleImpl<State, Actions> = {
6262
}
6363
actions.users.initAuthentication([authListener])
6464

65-
const searchFn = (text, range) => {
65+
const searchFn: SearchFn = (text, range) => {
6666
if (!text || text.trim() === "") {
6767
return projectsStore.query({
6868
collection: COLLECTION,
6969
where: [{ attribute: "hidden", op: "==", value: false }],
70-
first: range.value,
70+
first: range.index,
7171
limit: range.count
7272
})
7373
}
@@ -77,7 +77,7 @@ export const module: ModuleImpl<State, Actions> = {
7777
collection: COLLECTION,
7878
where: [{ attribute, op: ">", value: 0 }],
7979
orderBy: { attribute, descending: true },
80-
first: range.value,
80+
first: range.index,
8181
limit: range.count
8282
})
8383
}

src/users/module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ function signInWithProvider(
7878
resolve()
7979
})
8080
.catch(e => {
81-
console.log(e.code)
8281
if (e.code === "auth/credential-already-in-use") {
8382
// There is already an anonymous account linked to those credentials.
8483
// in this case, the only thing we can do is to signup the user normally.

0 commit comments

Comments
 (0)