Skip to content

Commit

Permalink
Fixed not using users discord id when submitting lora request
Browse files Browse the repository at this point in the history
  • Loading branch information
Metal079 committed Sep 8, 2024
1 parent 066039f commit 2ce3f4b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/app/home/add-loras/add-loras.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { DynamicDialogRef } from 'primeng/dynamicdialog';
import { DynamicDialogConfig } from 'primeng/dynamicdialog';
import { StableDiffusionService } from 'src/app/stable-diffusion.service';
import { MessageService } from 'primeng/api';
import { SharedService } from 'src/app/shared.service';


@Component({
Expand All @@ -28,6 +29,7 @@ export class AddLorasComponent {
, public config: DynamicDialogConfig
, private stableDiffusionService: StableDiffusionService
, private messageService: MessageService
, private sharedService: SharedService
) { }

selectOption(option: string) {
Expand Down Expand Up @@ -124,13 +126,16 @@ export class AddLorasComponent {
if (this.selectedLoRA) {
console.log(`Selected LoRA: ${this.selectedLoRA.name}`);

// Get the user's discord ID
const discordUserID = this.sharedService.getUserDataValue().discord_user_id;

// Create data to send to the backend
const data = {
'lora_version_id': this.selectedLoRA.model_version_id,
'name': this.selectedLoRA.name,
'version': this.selectedLoRA.model_name,
'status': 'pending',
'requestor': 'metal',
'requestor': discordUserID,
'is_nsfw': this.selectedLoRA.nsfw,
'is_minor': this.selectedLoRA.minor,
'preview_image': this.selectedLoRA.images[0].url,
Expand Down
2 changes: 1 addition & 1 deletion src/app/home/faq/faq.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class FaqComponent implements OnInit, OnDestroy {
}
}

ngOnDestroy() {
ngOnDestroy() {
this.subscription.unsubscribe();
}

Expand Down

0 comments on commit 2ce3f4b

Please sign in to comment.