fix(chat): restore scroll after image viewer return
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
} from "@/lib/chat/chat_media_url";
|
||||
import { useCachedChatMediaUrl } from "@/lib/chat/use_cached_chat_media_url";
|
||||
|
||||
import { requestChatScrollSnapshotSave } from "../chat-scroll-session";
|
||||
import styles from "./image-bubble.module.css";
|
||||
|
||||
export interface ImageBubbleProps {
|
||||
@@ -46,7 +47,8 @@ export function ImageBubble({
|
||||
|
||||
const openImage = () => {
|
||||
if (!messageId) return;
|
||||
router.push(ROUTE_BUILDERS.chatImage(messageId));
|
||||
requestChatScrollSnapshotSave();
|
||||
router.push(ROUTE_BUILDERS.chatImage(messageId), { scroll: false });
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user