fix: community load error undefined

This commit is contained in:
Xylight committed 2025-09-25 20:45:18 -07:00
1 parent 492ac92fd6
commit 25960c8b0e
2 files changed
+8 -5

No files matched your search

+7 -2
View File
@@ -195,12 +195,17 @@ export const userLink = (person: Person, prefix: string = '') =>
* Basic types only, don't use for anything more than basic equality * Basic types only, don't use for anything more than basic equality
*/ */
export function recursiveEqual<T>( export function recursiveEqual<T>(
a: NonNullable<T>, a: T,
b: NonNullable<T>, b: T,
): boolean { ): boolean {
if (a === b) return true if (a === b) return true
if (typeof a !== 'object' || typeof b !== 'object') return false if (typeof a !== 'object' || typeof b !== 'object') return false
if (a == null || b == null) {
if (a == null && b == null) return true
else return false
}
const keysA = Object.keys(a) as (keyof typeof a)[] const keysA = Object.keys(a) as (keyof typeof a)[]
const keysB = Object.keys(b) as (keyof typeof b)[] const keysB = Object.keys(b) as (keyof typeof b)[]
+1 -3
View File
@@ -29,9 +29,7 @@ export class Feed<Params, Response> {
async load(params: Params) { async load(params: Params) {
if ( if (
this.#lastParams && !recursiveEqual(params, this.#lastParams)
params &&
!recursiveEqual<Params>(params, this.#lastParams)
) { ) {
this.#data = undefined this.#data = undefined
} }