fix(mobile): rebuild comment sends when the draft's item changes

This commit is contained in:
Kelvin Amoaba
2026-11-09 03:08:59 +00:00
parent b66dc06c78
commit cdbc544327
4 changed files with 5 additions and 5 deletions
@@ -5,7 +5,7 @@ import {
useRef,
useState
} from './mobile-tasks-dependencies'
import { githubTaskKey } from './github-task-identity'
import { taskItemIdentity } from './task-draft-rows'
import type { ActionableTaskItem } from './mobile-tasks-project-workspace-types'
import type { DetailPayload } from './mobile-tasks-provider-detail-types'
import { isRpcDeliveryUnknown } from '../transport/rpc/rpc-delivery-ambiguity'
@@ -33,7 +33,7 @@ type CommentSendOutcome = {
}
function itemIdentity(item: ActionableTaskItem | null): string | null {
return item?.provider === 'github' ? githubTaskKey(item.source) : (item?.key ?? null)
return item && taskItemIdentity(item)
}
function sameCommentText(a: string, b: string): boolean {
@@ -160,7 +160,7 @@ export function useMobileTasksHostedCommentReviewActions<
finish()
}
},
[claimPublication, client, itemCommentDraft, tryBeginMutation]
[claimPublication, client, itemCommentDraft, setItemCommentDraft, tryBeginMutation]
)
const copyTaskLink = useCallback(
@@ -81,7 +81,7 @@ export function useMobileTasksLinearItemActions<
finish()
}
},
[client, linearCommentDraft, tryBeginMutation]
[client, linearCommentDraft, setLinearCommentDraft, tryBeginMutation]
)
const openLinearSubIssue = useCallback(
@@ -233,7 +233,7 @@ export function useMobileTasksProjectWorkspaceCommentActions(model: WorkspaceCre
setProjectMutating(false)
}
},
[activeGitHubProjectHost, client, projectCommentDraft, projectMutating]
[activeGitHubProjectHost, client, projectCommentDraft, projectMutating, setProjectCommentDraft]
)
const updateProjectRowComment = useCallback(