fix: fast scroll mark read

This commit is contained in:
DIYgod
2025-01-14 18:12:56 +08:00
parent 284a510217
commit 3dbf7c7ffa
2 changed files with 125 additions and 1 deletions
@@ -130,6 +130,10 @@ function EntryColumnImpl() {
const renderAsRead = useGeneralSettingKey("renderMarkUnread")
const handleRangeChange = useCallback(
(e: Range) => {
const [_, second] = rangeQueueRef.current
if (second?.startIndex === e.startIndex) {
return
}
rangeQueueRef.current.push(e)
if (rangeQueueRef.current.length > 2) {
rangeQueueRef.current.shift()
+121 -1
View File
@@ -2409,6 +2409,104 @@ declare const entryReadHistoriesOpenAPISchema: z.ZodObject<{
userIds: string[];
readCount: number;
}>;
declare const urlReads: drizzle_orm_pg_core.PgTableWithColumns<{
name: "urlReads";
schema: undefined;
columns: {
url: drizzle_orm_pg_core.PgColumn<{
name: "url";
tableName: "urlReads";
dataType: "string";
columnType: "PgText";
data: string;
driverParam: string;
notNull: true;
hasDefault: false;
isPrimaryKey: true;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: [string, ...string[]];
baseColumn: never;
identity: undefined;
generated: undefined;
}, {}, {}>;
userIds: drizzle_orm_pg_core.PgColumn<{
name: "user_ids";
tableName: "urlReads";
dataType: "array";
columnType: "PgArray";
data: string[];
driverParam: string | string[];
notNull: true;
hasDefault: true;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: [string, ...string[]];
baseColumn: drizzle_orm.Column<{
name: "user_ids";
tableName: "urlReads";
dataType: "string";
columnType: "PgText";
data: string;
driverParam: string;
notNull: false;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: [string, ...string[]];
baseColumn: never;
identity: undefined;
generated: undefined;
}, {}, {}>;
identity: undefined;
generated: undefined;
}, {}, {
baseBuilder: drizzle_orm_pg_core.PgColumnBuilder<{
name: "user_ids";
dataType: "string";
columnType: "PgText";
data: string;
enumValues: [string, ...string[]];
driverParam: string;
}, {}, {}, drizzle_orm.ColumnBuilderExtraConfig>;
size: undefined;
}>;
count: drizzle_orm_pg_core.PgColumn<{
name: "count";
tableName: "urlReads";
dataType: "number";
columnType: "PgInteger";
data: number;
driverParam: string | number;
notNull: true;
hasDefault: true;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: undefined;
baseColumn: never;
identity: undefined;
generated: undefined;
}, {}, {}>;
};
dialect: "pg";
}>;
type UrlReadsModel = InferInsertModel<typeof urlReads>;
declare const urlReadsOpenAPISchema: z.ZodObject<{
url: z.ZodString;
userIds: z.ZodArray<z.ZodString, "many">;
count: z.ZodNumber;
}, z.UnknownKeysParam, z.ZodTypeAny, {
url: string;
userIds: string[];
count: number;
}, {
url: string;
userIds: string[];
count: number;
}>;
declare const feeds: drizzle_orm_pg_core.PgTableWithColumns<{
name: "feeds";
@@ -2652,6 +2750,23 @@ declare const feeds: drizzle_orm_pg_core.PgTableWithColumns<{
identity: undefined;
generated: undefined;
}, {}, {}>;
migrateTo: drizzle_orm_pg_core.PgColumn<{
name: "migrate_to";
tableName: "feeds";
dataType: "string";
columnType: "PgText";
data: string;
driverParam: string;
notNull: false;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: [string, ...string[]];
baseColumn: never;
identity: undefined;
generated: undefined;
}, {}, {}>;
};
dialect: "pg";
}>;
@@ -2670,6 +2785,7 @@ declare const feedsOpenAPISchema: zod.ZodObject<{
errorAt: zod.ZodNullable<zod.ZodString>;
ownerUserId: zod.ZodNullable<zod.ZodString>;
language: zod.ZodNullable<zod.ZodString>;
migrateTo: zod.ZodNullable<zod.ZodString>;
}, zod.UnknownKeysParam, zod.ZodTypeAny, {
description: string | null;
title: string | null;
@@ -2685,6 +2801,7 @@ declare const feedsOpenAPISchema: zod.ZodObject<{
errorAt: string | null;
ownerUserId: string | null;
language: string | null;
migrateTo: string | null;
}, {
description: string | null;
title: string | null;
@@ -2700,11 +2817,13 @@ declare const feedsOpenAPISchema: zod.ZodObject<{
errorAt: string | null;
ownerUserId: string | null;
language: string | null;
migrateTo: string | null;
}>;
declare const feedsRelations: drizzle_orm.Relations<"feeds", {
subscriptions: drizzle_orm.Many<"subscriptions">;
entries: drizzle_orm.Many<"entries">;
owner: drizzle_orm.One<"user", false>;
migrateTo: drizzle_orm.One<"feeds", false>;
}>;
type FeedModel = InferInsertModel<typeof feeds>;
@@ -15333,6 +15452,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
errorAt: string | null;
ownerUserId: string | null;
language: string | null;
migrateTo: string | null;
} | null;
list: {
description: string | null;
@@ -16659,4 +16779,4 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
}, "/rsshub">, "/">;
type AppType = typeof _routes;
export { type ActionsModel, type AirdropActivity, type AppType, type AttachmentsModel, type AuthSession, type AuthUser, CommonEntryFields, type ConditionItem, type DetailModel, type EntriesModel, type EntryReadHistoriesModel, type ExtraModel, type FeedModel, type MediaModel, type MessagingData, MessagingType, type SettingsModel, account, achievements, achievementsOpenAPISchema, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, activityEnum, airdrops, airdropsOpenAPISchema, attachmentsZodSchema, authPlugins, boosts, collections, collectionsOpenAPISchema, collectionsRelations, detailModelSchema, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, extraZodSchema, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsOpenAPISchema, feedsRelations, inboxHandleSchema, inboxes, inboxesEntries, inboxesEntriesInsertOpenAPISchema, type inboxesEntriesModel, inboxesEntriesOpenAPISchema, inboxesEntriesRelations, inboxesOpenAPISchema, inboxesRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, levels, levelsOpenAPISchema, levelsRelations, lists, listsOpenAPISchema, listsRelations, listsSubscriptions, listsSubscriptionsOpenAPISchema, listsSubscriptionsRelations, listsTimeline, listsTimelineOpenAPISchema, listsTimelineRelations, lower, mediaZodSchema, messaging, messagingOpenAPISchema, messagingRelations, rsshub, rsshubOpenAPISchema, rsshubPurchase, rsshubUsage, rsshubUsageOpenAPISchema, rsshubUsageRelations, session, settings, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, twoFactor, user, users, usersOpenApiSchema, usersRelations, verification, wallets, walletsOpenAPISchema, walletsRelations };
export { type ActionsModel, type AirdropActivity, type AppType, type AttachmentsModel, type AuthSession, type AuthUser, CommonEntryFields, type ConditionItem, type DetailModel, type EntriesModel, type EntryReadHistoriesModel, type ExtraModel, type FeedModel, type MediaModel, type MessagingData, MessagingType, type SettingsModel, type UrlReadsModel, account, achievements, achievementsOpenAPISchema, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, activityEnum, airdrops, airdropsOpenAPISchema, attachmentsZodSchema, authPlugins, boosts, collections, collectionsOpenAPISchema, collectionsRelations, detailModelSchema, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, extraZodSchema, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsOpenAPISchema, feedsRelations, inboxHandleSchema, inboxes, inboxesEntries, inboxesEntriesInsertOpenAPISchema, type inboxesEntriesModel, inboxesEntriesOpenAPISchema, inboxesEntriesRelations, inboxesOpenAPISchema, inboxesRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, levels, levelsOpenAPISchema, levelsRelations, lists, listsOpenAPISchema, listsRelations, listsSubscriptions, listsSubscriptionsOpenAPISchema, listsSubscriptionsRelations, listsTimeline, listsTimelineOpenAPISchema, listsTimelineRelations, lower, mediaZodSchema, messaging, messagingOpenAPISchema, messagingRelations, rsshub, rsshubOpenAPISchema, rsshubPurchase, rsshubUsage, rsshubUsageOpenAPISchema, rsshubUsageRelations, session, settings, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, twoFactor, urlReads, urlReadsOpenAPISchema, user, users, usersOpenApiSchema, usersRelations, verification, wallets, walletsOpenAPISchema, walletsRelations };