Invert if cssAutofit

f649e4698b749c62c6f3c413605fb77d874f2569

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

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