Invert if cssAutofit

f649e4698b749c62c6f3c413605fb77d874f2569

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +6 -3Showing whitespace changes
public/scripts/RossAscends-mods.js+6 -3
@@ -916,7 +916,12 @@ export function initRossMods() {
916 }916 }
917917
918 sendTextArea.addEventListener('input', () => {918 sendTextArea.addEventListener('input', () => {
919 if (!cssAutofit) {919 saveUserInputDebounced();
920
921 if (cssAutofit) {
922 return;
923 }
924
920 const hasContent = sendTextArea.value !== '';925 const hasContent = sendTextArea.value !== '';
921 const fitsCurrentSize = sendTextArea.scrollHeight <= sendTextArea.offsetHeight;926 const fitsCurrentSize = sendTextArea.scrollHeight <= sendTextArea.offsetHeight;
922 const isScrollbarShown = sendTextArea.clientWidth < sendTextArea.offsetWidth;927 const isScrollbarShown = sendTextArea.clientWidth < sendTextArea.offsetWidth;
@@ -924,8 +929,6 @@ export function initRossMods() {
924 const needsDebounce = hasContent && (fitsCurrentSize || (isScrollbarShown && isHalfScreenHeight));929 const needsDebounce = hasContent && (fitsCurrentSize || (isScrollbarShown && isHalfScreenHeight));
925 if (needsDebounce) autoFitSendTextAreaDebounced();930 if (needsDebounce) autoFitSendTextAreaDebounced();
926 else autoFitSendTextArea();931 else autoFitSendTextArea();
927 }
928 saveUserInputDebounced();
929 });932 });
930933
931 restoreUserInput();934 restoreUserInput();