Skip to content

Commit 7b38a22

Browse files
committed
Revert "Fix padding bug + add space for new chats too (trypear#298)"
This reverts commit 79e54b1.
1 parent 53ca51f commit 7b38a22

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

gui/src/pages/gui.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ function GUI() {
233233
if (inputContainerRef.current && topGuiDivRef.current) {
234234
const scrollTop = topGuiDivRef.current.scrollTop;
235235
const height = inputContainerRef.current.offsetHeight;
236-
const newPadding = `${height + 20}px`;
236+
const newPadding = isNewSession ? '0px' : `${height + 20}px`;
237237

238238
topGuiDivRef.current.style.paddingBottom = '0px';
239239
topGuiDivRef.current.offsetHeight;
@@ -372,9 +372,8 @@ function GUI() {
372372
[state.history],
373373
);
374374

375-
const adjustPadding = useCallback(() => {
376-
if (inputContainerRef.current && topGuiDivRef.current) {
377-
const height = inputContainerRef.current.offsetHeight;
375+
const adjustPadding = useCallback((height: number) => {
376+
if (topGuiDivRef.current) {
378377
topGuiDivRef.current.style.paddingBottom = `${height + 20}px`;
379378
}
380379
}, []);

0 commit comments

Comments
 (0)