some-fixes

This commit is contained in:
tonyrewin 2022-10-05 11:55:26 +03:00
parent d4a68c30b2
commit 8f6bea06bd
7 changed files with 49 additions and 47 deletions

View File

@ -157,7 +157,7 @@ export type Mutation = {
markAsRead: Result markAsRead: Result
rateUser: Result rateUser: Result
refreshSession: AuthResult refreshSession: AuthResult
registerUser: User registerUser: AuthResult
removeAuthor: Result removeAuthor: Result
sendLink: Result sendLink: Result
unfollow: Result unfollow: Result

View File

@ -1,32 +1,39 @@
// import { persistentAtom } from '@nanostores/persistent' import { persistentAtom } from '@nanostores/persistent'
// import { Reaction, ReactionKind } from '../graphql/types.gen' import { Reaction, ReactionKind } from '../graphql/types.gen'
// import { atom, computed } from 'nanostores' import { atom, computed } from 'nanostores'
// import { reactionsOrdered } from './zine/reactions' import { reactions } from './zine/reactions'
//
// interface Draft { interface Draft {
// createdAt: Date createdAt: Date
// body?: string body?: string
// title?: string title?: string
// } }
//
// interface Collab { interface Collab {
// authors: string[] // slugs authors: string[] // slugs
// invites?: string[] invites?: string[]
// createdAt: Date createdAt: Date
// body?: string body?: string
// title?: string title?: string
// } }
//
// const drafts = persistentAtom<Draft[]>('drafts', [], { const drafts = persistentAtom<Draft[]>('drafts', [], {
// encode: JSON.stringify, encode: JSON.stringify,
// decode: JSON.parse decode: JSON.parse
// }) // save drafts on device }) // save drafts on device
// const collabs = atom<Collab[]>([])
// // save collabs in backend or in p2p network const collabs = atom<Collab[]>([]) // save collabs in backend or in p2p network
// const approvals = computed(reactionsOrdered, (rlist) => rlist.filter((r) => r.kind === ReactionKind.Accept))
// const proposals = computed<Reaction[], typeof reactionsOrdered>(reactionsOrdered, (rlist) => /*
// rlist.filter((r) => r.kind === ReactionKind.Propose) const approvals = computed(
// ) reactions,
// (rdict) => Object.values(rdict)
// export { drafts, collabs, approvals, proposals } .filter((r: Reaction) => r.kind === ReactionKind.Accept)
export {} )
const proposals = computed<Reaction[], typeof reactions>(
reactions,
(rdict) => Object.values(rdict)
.filter((r: Reaction) => r.kind === ReactionKind.Propose)
)
*/
export { drafts, collabs /* approvals, proposals */ }

View File

@ -1,6 +1,4 @@
// import { atom } from 'nanostores' import { atom } from 'nanostores'
// import type { Chat, Message } from '../graphql/types.gen' import type { ChatResult } from '../graphql/types.gen'
//
// export const chats = atom<Chat[]>([]) export const chats = atom<ChatResult[]>([])
// export const messages = atom<Message[]>([])
export {}

View File

@ -7,7 +7,7 @@ import { reduceBy } from '../../utils/reduce'
// FIXME // FIXME
let reactionsOrdered: WritableAtom<Reaction[]> let reactionsOrdered: WritableAtom<Reaction[]>
const reactions = atom<{ [slug: string]: Reaction[] }>({}) // by shout export const reactions = atom<{ [slug: string]: Reaction[] }>({}) // by shout
export const useReactionsStore = (initial?: Reaction[]) => { export const useReactionsStore = (initial?: Reaction[]) => {
if (!reactionsOrdered) { if (!reactionsOrdered) {

View File

@ -1,15 +1,15 @@
import type { Reaction, Shout, FollowingEntity, AuthResult } from '../graphql/types.gen' import type { Reaction, Shout, FollowingEntity, AuthResult } from '../graphql/types.gen'
import { getLogger } from './logger'
import { publicGraphQLClient } from '../graphql/publicGraphQLClient' import { publicGraphQLClient } from '../graphql/publicGraphQLClient'
import { privateGraphQLClient } from '../graphql/privateGraphQLClient'
import articleBySlug from '../graphql/query/article-by-slug' import articleBySlug from '../graphql/query/article-by-slug'
import articleReactions from '../graphql/query/article-reactions' import articleReactions from '../graphql/query/article-reactions'
import articlesRecentAll from '../graphql/query/articles-recent-all' import articlesRecentAll from '../graphql/query/articles-recent-all'
import articlesRecentPublished from '../graphql/query/articles-recent-published' import articlesRecentPublished from '../graphql/query/articles-recent-published'
import topicsAll from '../graphql/query/topics-all' import topicsAll from '../graphql/query/topics-all'
import { getLogger } from './logger'
import reactionsForShouts from '../graphql/query/reactions-for-shouts' import reactionsForShouts from '../graphql/query/reactions-for-shouts'
import mySession from '../graphql/mutation/my-session' import mySession from '../graphql/mutation/my-session'
import { privateGraphQLClient } from '../graphql/privateGraphQLClient'
import authLogoutQuery from '../graphql/mutation/auth-logout' import authLogoutQuery from '../graphql/mutation/auth-logout'
import authLoginQuery from '../graphql/query/auth-login' import authLoginQuery from '../graphql/query/auth-login'
import authRegisterMutation from '../graphql/mutation/auth-register' import authRegisterMutation from '../graphql/mutation/auth-register'

View File

@ -3,10 +3,7 @@ import prefix from 'loglevel-plugin-prefix'
import { isDev } from './config' import { isDev } from './config'
prefix.reg(loglevel) prefix.reg(loglevel)
prefix.apply(loglevel, { prefix.apply(loglevel, { template: '[%n]' })
template: '[%n]'
})
loglevel.setLevel(isDev ? loglevel.levels.TRACE : loglevel.levels.ERROR) loglevel.setLevel(isDev ? loglevel.levels.TRACE : loglevel.levels.ERROR)
export const getLogger = (name: string) => loglevel.getLogger(name) export const getLogger = (name: string) => loglevel.getLogger(name)

View File

@ -56,7 +56,7 @@ const ru2en: { [key: string]: string } = {
ь: 'i', ь: 'i',
Ы: 'Y', Ы: 'Y',
ы: 'y', ы: 'y',
ъ: "'", ъ: 'j',
Э: 'E', Э: 'E',
э: 'e', э: 'e',
Ю: 'Yu', Ю: 'Yu',