Auto-select a newly created distribution list or group when sending story
This commit is contained in:
parent
81e4564687
commit
2db14e8d6f
14 changed files with 94 additions and 26 deletions
|
@ -56,7 +56,7 @@ export type PropsType = {
|
|||
onDistributionListCreated: (
|
||||
name: string,
|
||||
viewerUuids: Array<UUIDStringType>
|
||||
) => unknown;
|
||||
) => Promise<UUIDStringType>;
|
||||
onSelectedStoryList: (options: {
|
||||
conversationId: string;
|
||||
distributionId: string | undefined;
|
||||
|
@ -67,7 +67,7 @@ export type PropsType = {
|
|||
conversationIds: Array<string>
|
||||
) => unknown;
|
||||
signalConnections: Array<ConversationType>;
|
||||
toggleGroupsForStorySend: (cids: Array<string>) => unknown;
|
||||
toggleGroupsForStorySend: (cids: Array<string>) => Promise<void>;
|
||||
mostRecentActiveStoryTimestampByGroupOrDistributionList: Record<
|
||||
string,
|
||||
number
|
||||
|
@ -419,9 +419,17 @@ export function SendStoryModal({
|
|||
candidateConversations={candidateConversations}
|
||||
getPreferredBadge={getPreferredBadge}
|
||||
i18n={i18n}
|
||||
onCreateList={(name, uuids) => {
|
||||
onCreateList={async (name, uuids) => {
|
||||
const newDistributionListId = await onDistributionListCreated(
|
||||
name,
|
||||
uuids
|
||||
);
|
||||
|
||||
setSelectedContacts([]);
|
||||
onDistributionListCreated(name, uuids);
|
||||
setSelectedListIds(
|
||||
listIds => new Set([...listIds, newDistributionListId])
|
||||
);
|
||||
|
||||
setPage(Page.SendStory);
|
||||
}}
|
||||
onViewersUpdated={uuids => {
|
||||
|
@ -480,9 +488,10 @@ export function SendStoryModal({
|
|||
aria-label={i18n('ok')}
|
||||
className="SendStoryModal__ok"
|
||||
disabled={!chosenGroupIds.size}
|
||||
onClick={() => {
|
||||
toggleGroupsForStorySend(Array.from(chosenGroupIds));
|
||||
onClick={async () => {
|
||||
await toggleGroupsForStorySend(Array.from(chosenGroupIds));
|
||||
setChosenGroupIds(new Set());
|
||||
setSelectedGroupIds(chosenGroupIds);
|
||||
setPage(Page.SendStory);
|
||||
}}
|
||||
type="button"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue