Skip to content

Commit

Permalink
refactor: MessageInputTextArea コンポーネントのウォッチャーに immediate オプションを追加し、on…
Browse files Browse the repository at this point in the history
…Mounted での処理を削除
  • Loading branch information
reiroop committed Feb 2, 2025
1 parent 07ebd22 commit 515e492
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/components/Main/MainView/MessageInput/MessageInputTextArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</template>

<script lang="ts" setup>
import { computed, nextTick, onMounted, ref, watch } from 'vue'
import { computed, nextTick, ref, watch } from 'vue'
import usePaste from './composables/usePaste'

Check warning on line 39 in src/components/Main/MainView/MessageInput/MessageInputTextArea.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageInput/MessageInputTextArea.vue#L38-L39

Added lines #L38 - L39 were not covered by tests
import useSendKeyWatcher from './composables/useSendKeyWatcher'
import useWordSuggester from './composables/useWordSuggester'
Expand Down Expand Up @@ -165,15 +165,15 @@ const updateTextareaExpandButtonVisibility = () => {
}
}

Check warning on line 166 in src/components/Main/MainView/MessageInput/MessageInputTextArea.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageInput/MessageInputTextArea.vue#L157-L166

Added lines #L157 - L166 were not covered by tests
onMounted(() => {
updateTextareaExpandButtonVisibility()
})
watch(value, () => {
nextTick(() => {
updateTextareaExpandButtonVisibility()
})
})
watch(
value,
() => {
nextTick(() => {
updateTextareaExpandButtonVisibility()
})
},
{ immediate: true }
)

Check warning on line 176 in src/components/Main/MainView/MessageInput/MessageInputTextArea.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageInput/MessageInputTextArea.vue#L168-L176

Added lines #L168 - L176 were not covered by tests
</script>

<style lang="scss" module>
Expand Down

0 comments on commit 515e492

Please sign in to comment.