Moves group link management actions to redux
This commit is contained in:
parent
5c8b4bca7e
commit
410bc52fd0
6 changed files with 122 additions and 67 deletions
|
@ -101,7 +101,6 @@ import { ToastTapToViewExpiredOutgoing } from '../components/ToastTapToViewExpir
|
|||
import { ToastUnableToLoadAttachment } from '../components/ToastUnableToLoadAttachment';
|
||||
import { ToastCannotOpenGiftBadge } from '../components/ToastCannotOpenGiftBadge';
|
||||
import { autoScale } from '../util/handleImageAttachment';
|
||||
import { copyGroupLink } from '../util/copyGroupLink';
|
||||
import { deleteDraftAttachment } from '../util/deleteDraftAttachment';
|
||||
import { markAllAsApproved } from '../util/markAllAsApproved';
|
||||
import { markAllAsVerifiedDefault } from '../util/markAllAsVerifiedDefault';
|
||||
|
@ -2207,12 +2206,7 @@ export class ConversationView extends window.Backbone.View<ConversationModel> {
|
|||
JSX: window.Signal.State.Roots.createGroupLinkManagement(
|
||||
window.reduxStore,
|
||||
{
|
||||
changeHasGroupLink: this.changeHasGroupLink.bind(this),
|
||||
conversationId: this.model.id,
|
||||
copyGroupLink,
|
||||
generateNewGroupLink: this.generateNewGroupLink.bind(this),
|
||||
setAccessControlAddFromInviteLinkSetting:
|
||||
this.setAccessControlAddFromInviteLinkSetting.bind(this),
|
||||
}
|
||||
),
|
||||
});
|
||||
|
@ -2606,42 +2600,6 @@ export class ConversationView extends window.Backbone.View<ConversationModel> {
|
|||
});
|
||||
}
|
||||
|
||||
async changeHasGroupLink(value: boolean): Promise<void> {
|
||||
const { model }: { model: ConversationModel } = this;
|
||||
|
||||
await this.longRunningTaskWrapper({
|
||||
name: 'toggleGroupLink',
|
||||
task: async () => model.toggleGroupLink(value),
|
||||
});
|
||||
}
|
||||
|
||||
async generateNewGroupLink(): Promise<void> {
|
||||
const { model }: { model: ConversationModel } = this;
|
||||
|
||||
window.showConfirmationDialog({
|
||||
confirmStyle: 'negative',
|
||||
message: window.i18n('GroupLinkManagement--confirm-reset'),
|
||||
okText: window.i18n('GroupLinkManagement--reset'),
|
||||
resolve: async () => {
|
||||
await this.longRunningTaskWrapper({
|
||||
name: 'refreshGroupLink',
|
||||
task: async () => model.refreshGroupLink(),
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async setAccessControlAddFromInviteLinkSetting(
|
||||
value: boolean
|
||||
): Promise<void> {
|
||||
const { model }: { model: ConversationModel } = this;
|
||||
|
||||
await this.longRunningTaskWrapper({
|
||||
name: 'updateAccessControlAddFromInviteLink',
|
||||
task: async () => model.updateAccessControlAddFromInviteLink(value),
|
||||
});
|
||||
}
|
||||
|
||||
async setAccessControlAttributesSetting(value: number): Promise<void> {
|
||||
const { model }: { model: ConversationModel } = this;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue