forked from Archives/Athou_commafeed
update all dependencies
This commit is contained in:
@@ -93,12 +93,12 @@ export const client = {
|
||||
* @param err an error object (e.g. from axios)
|
||||
* @returns an array of messages to show the user
|
||||
*/
|
||||
export const errorToStrings = (err: any) => {
|
||||
export const errorToStrings = (err: unknown) => {
|
||||
let strings: string[] = []
|
||||
|
||||
if (axios.isAxiosError(err)) {
|
||||
if (err.response) {
|
||||
const data = err.response.data as any
|
||||
const { data } = err.response
|
||||
if (typeof data === "string") strings.push(data)
|
||||
if (typeof data === "object" && data.message) strings.push(data.message)
|
||||
if (typeof data === "object" && data.errors) strings = [...strings, ...data.errors]
|
||||
|
||||
@@ -30,8 +30,10 @@ const transform: TransformCallback = node => {
|
||||
const src = node.getAttribute("src") ?? undefined
|
||||
const alt = node.getAttribute("alt") ?? undefined
|
||||
const title = node.getAttribute("title") ?? undefined
|
||||
const width = node.getAttribute("width") ? parseInt(node.getAttribute("width")!, 10) : undefined
|
||||
const height = node.getAttribute("height") ? parseInt(node.getAttribute("height")!, 10) : undefined
|
||||
const nodeWidth = node.getAttribute("width")
|
||||
const nodeHeight = node.getAttribute("height")
|
||||
const width = nodeWidth ? parseInt(nodeWidth, 10) : undefined
|
||||
const height = nodeHeight ? parseInt(nodeHeight, 10) : undefined
|
||||
const placeholderSize = calculatePlaceholderSize({
|
||||
width,
|
||||
height,
|
||||
|
||||
@@ -243,7 +243,7 @@ export function FeedEntries() {
|
||||
<div
|
||||
key={entry.id}
|
||||
ref={el => {
|
||||
refs.current[entry.id] = el!
|
||||
if (el) refs.current[entry.id] = el
|
||||
}}
|
||||
>
|
||||
<FeedEntry
|
||||
|
||||
@@ -74,7 +74,7 @@ export function Tree() {
|
||||
/>
|
||||
)
|
||||
|
||||
const categoryNode = (category: Category, level: number = 0) => {
|
||||
const categoryNode = (category: Category, level = 0) => {
|
||||
const unreadCount = categoryUnreadCount(category)
|
||||
if (unreadCount === 0 && !showRead) return null
|
||||
|
||||
@@ -96,7 +96,7 @@ export function Tree() {
|
||||
)
|
||||
}
|
||||
|
||||
const feedNode = (feed: Subscription, level: number = 0) => {
|
||||
const feedNode = (feed: Subscription, level = 0) => {
|
||||
if (feed.unread === 0 && !showRead) return null
|
||||
|
||||
return (
|
||||
@@ -114,7 +114,7 @@ export function Tree() {
|
||||
)
|
||||
}
|
||||
|
||||
const recursiveCategoryNode = (category: Category, level: number = 0) => (
|
||||
const recursiveCategoryNode = (category: Category, level = 0) => (
|
||||
<React.Fragment key={`recursiveCategoryNode-${category.id}`}>
|
||||
{categoryNode(category, level)}
|
||||
{category.expanded && category.children.map(c => recursiveCategoryNode(c, level + 1))}
|
||||
|
||||
Reference in New Issue
Block a user