mirror of
https://github.com/arthyn/sphinx.git
synced 2024-12-25 08:52:32 +03:00
posts: fixing logic and cleaning up debugger/console.logs
This commit is contained in:
parent
aac4333e0a
commit
1607b4e307
@ -14,7 +14,6 @@ interface ListingsProps {
|
||||
|
||||
export const Listings = ({ listings, remove, className }: ListingsProps) => {
|
||||
const { installed, outgoing, remove: removePal } = usePals();
|
||||
console.log(outgoing);
|
||||
if (!listings) {
|
||||
return null;
|
||||
}
|
||||
|
@ -68,10 +68,6 @@ export const TagField = ({ tags, onTags, className }: TagFieldProps) => {
|
||||
value: OnChangeValue<Option, true>,
|
||||
actionMeta: ActionMeta<Option>
|
||||
) => {
|
||||
console.group('Value Changed');
|
||||
console.log(value);
|
||||
console.log(`action: ${actionMeta.action}`);
|
||||
console.groupEnd();
|
||||
onTags(value);
|
||||
}, []);
|
||||
|
||||
@ -85,10 +81,6 @@ export const TagField = ({ tags, onTags, className }: TagFieldProps) => {
|
||||
switch (event.key) {
|
||||
case 'Enter':
|
||||
case 'Tab':
|
||||
console.group('Value Added');
|
||||
console.log(tags);
|
||||
console.groupEnd();
|
||||
|
||||
setInput('');
|
||||
onTags([...tags, createOption(input)])
|
||||
event.preventDefault();
|
||||
|
@ -39,7 +39,6 @@ export const Post = () => {
|
||||
const type = watch('type');
|
||||
|
||||
const onSubmit = useCallback((values: Omit<PostForm, 'tags'>) => {
|
||||
debugger;
|
||||
api.poke<Declare>({
|
||||
app: 'sphinx',
|
||||
mark: 'declare',
|
||||
|
@ -32,7 +32,6 @@ export const useNotebooks = () => {
|
||||
const { data, isLoading: metadataLoading } = useQuery('metadata', () => api.subscribeOnce<MetaDataUpdate>('metadata-store', '/all'));
|
||||
const { groups, loading } = usePublicGroups(data || {} as MetaDataUpdate);
|
||||
|
||||
console.log(keys);
|
||||
const notebooks: Record<string, Association<MetadataConfig>> = _.fromPairs(!data || loading ? [] : Object.entries(data['metadata-update'].associations)
|
||||
.filter(([,v]) => v['app-name'] === 'graph'
|
||||
&& 'graph' in v.metadata.config
|
||||
@ -41,8 +40,6 @@ export const useNotebooks = () => {
|
||||
&& groups.find(([, gv]) => gv.group === v.group)
|
||||
).map(([,v]) => [v.resource.replace('/ship/', ''), v]));
|
||||
|
||||
console.log(data)
|
||||
|
||||
return {
|
||||
loading: metadataLoading || loading,
|
||||
notebooks,
|
||||
@ -85,7 +82,7 @@ export const usePosts = (ship: string, name: string, type: PostType, tags: strin
|
||||
}}
|
||||
}) : [];
|
||||
|
||||
const posts = items.filter(p => !d || d.listings.length === 0 || d.listings.find(l => l.post.link === p.post.link));
|
||||
const posts = items.filter(p => !d || d.listings.length === 0 || !d.listings.find(l => l.post.link === p.post.link));
|
||||
|
||||
return {
|
||||
notebook: association,
|
||||
@ -130,7 +127,6 @@ export function getSnippet(body: Content[]): { image: string, content: string }
|
||||
|
||||
let sum = 0;
|
||||
const firstContent = body.reduce((text, c) => {
|
||||
debugger;
|
||||
if ('text' in c && sum < 255) {
|
||||
sum += removeMd(c.text).length;
|
||||
return text + c.text + ' ';
|
||||
@ -143,9 +139,6 @@ export function getSnippet(body: Content[]): { image: string, content: string }
|
||||
const end = content.length > 256 ? 255 : content.length;
|
||||
const start = content.substring(0, end);
|
||||
|
||||
if (firstContent.match(/jiddu/i)) {
|
||||
debugger;
|
||||
}
|
||||
return {
|
||||
content: start === firstContent ? start : `${start}...`,
|
||||
image: getImage(firstContent) || image
|
||||
|
Loading…
Reference in New Issue
Block a user