2020-11-04 20:49:08 +01:00
|
|
|
import { DatePipe } from "@angular/common";
|
|
|
|
|
|
|
|
import { Component } from "@angular/core";
|
|
|
|
|
2021-06-07 20:13:58 +02:00
|
|
|
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
|
|
|
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
2021-12-14 17:10:26 +01:00
|
|
|
import { LogService } from "jslib-common/abstractions/log.service";
|
2021-06-07 20:13:58 +02:00
|
|
|
import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
|
|
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
|
|
|
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
|
|
|
import { SendService } from "jslib-common/abstractions/send.service";
|
2021-12-14 17:10:26 +01:00
|
|
|
import { StateService } from "jslib-common/abstractions/state.service";
|
2020-11-04 20:49:08 +01:00
|
|
|
|
2021-06-07 20:13:58 +02:00
|
|
|
import { AddEditComponent as BaseAddEditComponent } from "jslib-angular/components/send/add-edit.component";
|
2020-11-04 20:49:08 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: "app-send-add-edit",
|
|
|
|
templateUrl: "add-edit.component.html",
|
|
|
|
})
|
2021-02-01 17:30:27 +01:00
|
|
|
export class AddEditComponent extends BaseAddEditComponent {
|
|
|
|
constructor(
|
|
|
|
i18nService: I18nService,
|
|
|
|
platformUtilsService: PlatformUtilsService,
|
|
|
|
environmentService: EnvironmentService,
|
|
|
|
datePipe: DatePipe,
|
2021-12-14 17:10:26 +01:00
|
|
|
sendService: SendService,
|
|
|
|
stateService: StateService,
|
2021-10-20 18:30:04 +02:00
|
|
|
messagingService: MessagingService,
|
|
|
|
policyService: PolicyService,
|
|
|
|
logService: LogService
|
|
|
|
) {
|
2021-12-14 17:10:26 +01:00
|
|
|
super(
|
|
|
|
i18nService,
|
|
|
|
platformUtilsService,
|
|
|
|
environmentService,
|
|
|
|
datePipe,
|
|
|
|
sendService,
|
|
|
|
messagingService,
|
|
|
|
policyService,
|
|
|
|
logService,
|
|
|
|
stateService
|
|
|
|
);
|
2021-01-05 20:45:23 +01:00
|
|
|
}
|
2021-02-08 22:07:40 +01:00
|
|
|
|
2021-05-12 02:51:12 +02:00
|
|
|
async copyLinkToClipboard(link: string): Promise<void | boolean> {
|
2021-02-08 22:07:40 +01:00
|
|
|
// Copy function on web depends on the modal being open or not. Since this event occurs during a transition
|
|
|
|
// of the modal closing we need to add a small delay to make sure state of the DOM is consistent.
|
2021-05-12 02:51:12 +02:00
|
|
|
return new Promise((resolve) => {
|
|
|
|
window.setTimeout(() => resolve(super.copyLinkToClipboard(link)), 500);
|
|
|
|
});
|
2021-02-08 22:07:40 +01:00
|
|
|
}
|
2020-11-04 20:49:08 +01:00
|
|
|
}
|