Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/people/widgetViews/workspace/EditWorkspaceModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ const EditWorkspaceModal = (props: EditWorkspaceModalProps) => {
let img = '';
const formData = new FormData();
if (rawSelectedFile) {
console.log('rawSelectedFile: ' + JSON.stringify(rawSelectedFile));
console.log('selectedImage: ' + JSON.stringify(selectedImage));
formData.append('file', rawSelectedFile);
console.log('Form Data: ' + JSON.stringify(formData));
const file = await main.uploadFile(formData);
Expand Down Expand Up @@ -251,6 +253,7 @@ const EditWorkspaceModal = (props: EditWorkspaceModalProps) => {
const handleFileInputChange = (e: ChangeEvent<HTMLInputElement>) => {
const file = e.target.files && e.target.files[0];
if (file) {
console.log('File: ' + JSON.stringify(file));
// Display the selected image
const imageUrl = URL.createObjectURL(file);
setSelectedImage(imageUrl);
Expand All @@ -264,6 +267,7 @@ const EditWorkspaceModal = (props: EditWorkspaceModalProps) => {
event.preventDefault();
const file = event.dataTransfer.files[0];
if (file) {
console.log('File: ' + JSON.stringify(file));
const imageUrl = URL.createObjectURL(file);
setSelectedImage(imageUrl);
setRawSelectedFile(file);
Expand Down
Loading