mirror of
https://github.com/bitwarden/browser
synced 2026-02-19 19:04:01 +00:00
[PM-31158] Change default send to file for old ui (#18526)
* Change default send to file for old ui * Trigger change detection to ensure signals are refreshed
This commit is contained in:
committed by
jaasen-livefront
parent
97ce4181a6
commit
0af9aed3d9
@@ -79,7 +79,6 @@ export class SendV2Component {
|
||||
|
||||
protected readonly sendId = signal<string | null>(null);
|
||||
protected readonly action = signal<Action>(Action.None);
|
||||
private readonly selectedSendTypeOverride = signal<SendType | undefined>(undefined);
|
||||
|
||||
private sendFormConfigService = inject(DefaultSendFormConfigService);
|
||||
private sendItemsService = inject(SendItemsService);
|
||||
@@ -151,10 +150,9 @@ export class SendV2Component {
|
||||
|
||||
protected readonly selectedSendType = computed(() => {
|
||||
const action = this.action();
|
||||
const typeOverride = this.selectedSendTypeOverride();
|
||||
|
||||
if (action === Action.Add && typeOverride !== undefined) {
|
||||
return typeOverride;
|
||||
if (action === Action.Add) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const sendId = this.sendId();
|
||||
@@ -173,24 +171,20 @@ export class SendV2Component {
|
||||
} else {
|
||||
this.action.set(Action.Add);
|
||||
this.sendId.set(null);
|
||||
this.selectedSendTypeOverride.set(type);
|
||||
|
||||
const component = this.addEditComponent();
|
||||
if (component) {
|
||||
await component.resetAndLoad();
|
||||
}
|
||||
this.cdr.detectChanges();
|
||||
void this.addEditComponent()?.resetAndLoad();
|
||||
}
|
||||
}
|
||||
|
||||
/** Used by old UI to add a send without specifying type (defaults to Text) */
|
||||
/** Used by old UI to add a send without specifying type (defaults to File) */
|
||||
protected async addSendWithoutType(): Promise<void> {
|
||||
await this.addSend(SendType.Text);
|
||||
await this.addSend(SendType.File);
|
||||
}
|
||||
|
||||
protected closeEditPanel(): void {
|
||||
this.action.set(Action.None);
|
||||
this.sendId.set(null);
|
||||
this.selectedSendTypeOverride.set(undefined);
|
||||
}
|
||||
|
||||
protected async savedSend(send: SendView): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user