Skip to content

Commit

Permalink
Css fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Jun 2, 2023
1 parent 05149dc commit f24bec9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ui/demo/index.html
Expand Up @@ -64,7 +64,7 @@
.oneFile=${true}
required
name="file_hash"
style="flex: 1"
style="max-width: 20px; max-height:20px"
@file-uploaded=${(e) => {
this.hash = e.detail.file.hash;
}}
Expand Down
4 changes: 2 additions & 2 deletions ui/package.json
@@ -1,6 +1,6 @@
{
"name": "@holochain-open-dev/file-storage",
"version": "0.4.2",
"version": "0.4.3",
"description": "File storage utilities to store and retrieve files in a holochain DHT",
"author": "guillem.cordoba@gmail.com",
"license": "MIT",
Expand All @@ -25,7 +25,7 @@
"@lit-labs/context": "^0.2.0",
"@lit-labs/task": "^2.0.0",
"@lit/localize": "^0.11.4",
"@scoped-elements/dropzone": "^0.2.0",
"@scoped-elements/dropzone": "^0.2.1",
"@shoelace-style/shoelace": "^2.3.0",
"lit": "^2.6.0"
},
Expand Down
13 changes: 7 additions & 6 deletions ui/src/elements/upload-files.ts
Expand Up @@ -75,7 +75,13 @@ export class UploadFiles extends DropzoneElement implements FormField {

async firstUpdated() {
super.firstUpdated();
if (this.defaultValue !== undefined) {

this.reset();
}

async reset() {
this.clear();
if (this.defaultValue) {
if (Array.isArray(this.defaultValue)) {
for (const fileHash of this.defaultValue) {
const image = await this._client.downloadFile(fileHash);
Expand All @@ -88,11 +94,6 @@ export class UploadFiles extends DropzoneElement implements FormField {
}
}

reset() {
this.dropzone.removeAllFiles(true);
this.clear();
}

/**
* @internal
*/
Expand Down

0 comments on commit f24bec9

Please sign in to comment.