Skip to content

Commit

Permalink
refactor(editor/hooks): simplify types
Browse files Browse the repository at this point in the history
  • Loading branch information
exuanbo committed Dec 3, 2023
1 parent 5432ca6 commit 2356eeb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/features/editor/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { applySelector, useSelector } from '@/app/selector'
import { store } from '@/app/store'
import { subscribe } from '@/app/subscribe'
import { UPDATE_TIMEOUT_MS } from '@/common/constants'
import type { Nullable } from '@/common/utils'
import { assemble as assembleFrom } from '@/features/assembler/assemble'
import {
clearAssemblerError,
Expand Down Expand Up @@ -74,7 +73,7 @@ export const useSyncInput = (): void => {
}
window.clearTimeout(syncInputTimeoutId)
// only consider the first transaction
const transaction = update.transactions[0] as Nullable<Transaction>
const transaction = update.transactions[0] as Transaction | undefined
if (transaction && isSyncFromState(transaction)) {
return
}
Expand Down Expand Up @@ -223,7 +222,7 @@ export const useBreakpoints = (): void => {
}
} else {
// only consider the first transaction
const transaction = update.transactions[0] as Nullable<Transaction>
const transaction = update.transactions[0] as Transaction | undefined
if (!transaction || isSyncFromState(transaction)) {
return
}
Expand Down

0 comments on commit 2356eeb

Please sign in to comment.