]> git.r.bdr.sh - rbdr/forum/blobdiff - src/components/topic/topic.svelte
Add topics store pact tests
[rbdr/forum] / src / components / topic / topic.svelte
index 181b429557fde68a23a9cdc9ad185dcfc03e83c1..c0dbfbc4b23755754a2103b1619ac756a7b30961 100644 (file)
@@ -5,7 +5,7 @@
        import Post from '$/components/post/post.svelte';
        import { readableTime } from '$/utils/readable_time.js';
 
-       $: remainingTime = topic ? topic.updated_at + topic.ttl - Date.now() : 0;
+       $: remainingTime = topic.updated_at + topic.ttl - Date.now();
        $: remaining = readableTime(remainingTime);
 </script>
 
        <h1 class="p-name">{topic.title}</h1>
        <aside class="topic-meta" title={$_('topic.metadata_title')}>
                {#if topic.forum}
-                       <span class="topic-location"
-                               >{$_('topic.category_location')}
-                               <a href="/f/{topic.forum.id}" class="p-category"
-                                       >{topic.forum.glyph} {$_(topic.forum.label)}</a
-                               >.</span
-                       >
+                       <span class="topic-location">
+        {$_('topic.category_location')}
+                               <a href="/f/{topic.forum.id}" class="p-category">
+          {topic.forum.glyph} {$_(topic.forum.label)}
+        </a>.
+      </span>
                {/if}
-               <span class="topic-ttl"
-                       ><a class="u-url u-uid" title={$_('topic.permalink_title')} href="/t/{topic.id}"
-                               >({$_('topic.remaining_time', {
+               <span class="topic-ttl">
+      <a class="u-url u-uid" title={$_('topic.permalink_title')} href="/t/{topic.id}">
+        ({$_('topic.remaining_time', {
                                        values: { remaining: $_(remaining.label, { values: { count: remaining.count } }) }
-                               })})</a
-                       >.</span
-               >
+        })})
+      </a>.
+    </span>
        </aside>
        {#if topic.tags.length > 0}
                <aside class="topic-tags" title={$_('topic.tags_title')}>
                        {$_('topic.tags_location')}
                        {#each topic.tags as tag}
-                               <a href="/g/{tag.id}" class="p-category"
-                                       >{tag.id}<span class="tag-weight">({tag.weight})</span></a
-                               >{' '}
+                               <a href="/g/{tag.id}" class="p-category">
+          {tag.id}<span class="tag-weight">({tag.weight})</span>
+        </a>{' '}
                        {/each}
                </aside>
        {/if}