Browse Source

Adds feedback to link copying

main
Eric Amodio 1 year ago
parent
commit
4131f38406
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      src/webviews/apps/plus/patchDetails/components/gl-draft-details.ts

+ 6
- 1
src/webviews/apps/plus/patchDetails/components/gl-draft-details.ts View File

@ -86,6 +86,9 @@ export class GlDraftDetails extends GlTreeBase {
@state() @state()
validityMessage?: string; validityMessage?: string;
@state()
private _copiedLink: boolean = false;
get canSubmit() { get canSubmit() {
return this.selectedPatches.length > 0; return this.selectedPatches.length > 0;
// return this.state.draft?.repoPath != null && this.state.draft?.baseRef != null; // return this.state.draft?.repoPath != null && this.state.draft?.baseRef != null;
@ -423,7 +426,7 @@ export class GlDraftDetails extends GlTreeBase {
this.state?.draft?.draftType === 'cloud', this.state?.draft?.draftType === 'cloud',
() => html` () => html`
<a class="commit-action" href="#" @click=${this.onCopyCloudLink}> <a class="commit-action" href="#" @click=${this.onCopyCloudLink}>
<code-icon icon="link"></code-icon>
<code-icon icon="${this._copiedLink ? 'check' : 'link'}"></code-icon>
<span class="top-details__sha">Copy Link</span></a <span class="top-details__sha">Copy Link</span></a
> >
`, `,
@ -625,6 +628,8 @@ export class GlDraftDetails extends GlTreeBase {
onCopyCloudLink() { onCopyCloudLink() {
this.fireEvent('gl-patch-details-copy-cloud-link', { draft: this.state.draft! }); this.fireEvent('gl-patch-details-copy-cloud-link', { draft: this.state.draft! });
this._copiedLink = true;
setTimeout(() => (this._copiedLink = false), 1000);
} }
onShareLocalPatch() { onShareLocalPatch() {

Loading…
Cancel
Save