Skip to content

Commit

Permalink
fix ui bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zippy committed Sep 23, 2023
1 parent 6b9b3ca commit 0ee8994
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dnas/kando/workdir/dna.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ integrity:
network_seed: ~
properties:
type: "KanDo"
origin_time: 2023-07-03T23:05:19.470323Z
origin_time: 2023-09-22T23:05:19.470323Z
zomes:
- name: syn_integrity
bundled: ../../../target/wasm32-unknown-unknown/release/syn_integrity.wasm
Expand Down
10 changes: 7 additions & 3 deletions ui/src/AboutDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@
reader.addEventListener("load", async () => {
const b = JSON.parse(reader.result as string)
for (const [idx, card] of b.cards.entries()) {
if (card.comments && typeof(card.comments.length) === "number") {
if (!card.comments) {
card.comments = {}
} else if ( typeof(card.comments.length) === "number") {
// array of comments, convert to object
const comments = {}
for (const c of card.comments) {
comments[c.id] = c
}
card.comments = comments
}
if (card.checklists && typeof(card.checklists.length) === "number") {
if (!card.checklists) {
card.checklists = {}
} else if (typeof(card.checklists.length) === "number") {
// array of checklists, convert to object
const checklists = {}
let i = 0
Expand All @@ -54,7 +58,7 @@
</script>


<sl-dialog label="KanDo!: UI v0.5.0-beta4 for DNA v0.3.x" bind:this={dialog} width={600} >
<sl-dialog label="KanDo!: UI v0.5.2 for DNA v0.4.x" bind:this={dialog} width={600} >
<div class="about">
<p>KanDo! is a demonstration Holochain app built by the Holochain Foundation.</p>
<p> <b>Developers:</b>
Expand Down
6 changes: 3 additions & 3 deletions ui/src/KanDoPane.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -509,18 +509,18 @@
</div>
<div class="card-description">{@html Marked.parse(props.description)}</div>
</div>
{#if (props && props.agents && props.agents.length > 0) || ( Object.keys(comments).length>0) || (Object.keys(checklists).length> 0)}
{#if (props && props.agents && props.agents.length > 0) || ( comments && Object.keys(comments).length>0) || (checklists && Object.keys(checklists).length> 0)}
<div class="contributors">
{#if props && props.agents && props.agents.length > 0}
{#each props.agents as agent}
<AvatarIcon size={20} avatar={$avatars[agent]} key={decodeHashFromBase64(agent)}/>
{/each}
{/if}
<div class="comments-checklist">
{#if Object.keys(checklists).length>0}
{#if checklists && Object.keys(checklists).length>0}
<div class="checklist-count"><Fa icon={faCheck} /> {checkedChecklistItems(checklists)} / {totalChecklistItems(checklists)}</div>
{/if}
{#if Object.keys(comments).length>0}
{#if comments && Object.keys(comments).length>0}
<div class="comment-count"><Fa icon={faComments} />: {Object.keys(comments).length}</div>
{/if}
</div>
Expand Down

0 comments on commit 0ee8994

Please sign in to comment.