@axium/tasks 0.5.5 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,12 +17,12 @@
17
17
  lists?: WithRequired<TaskList, 'tasks'>[];
18
18
  } = $props();
19
19
 
20
- const { user } = page.data.session;
20
+ const { user } = page.data.session || {};
21
21
 
22
22
  let tasks = $state(list.tasks),
23
23
  open = $state(false);
24
24
 
25
- const { show_completed_subtasks } = await preferences.get(user.id, 'tasks');
25
+ const { show_completed_subtasks } = user ? await preferences.get(user.id, 'tasks') : {};
26
26
  const showCompletedInline = show_completed_subtasks == 'inline';
27
27
 
28
28
  const tree = $derived(buildTaskTree(tasks));
@@ -33,8 +33,8 @@
33
33
  const children = tasks
34
34
  .filter(t => t.parentId === task.id)
35
35
  .map(exportTask)
36
- .map(str => '\t' + str)
37
- .join('\n');
36
+ .map(str => '\n\t' + str)
37
+ .join('');
38
38
 
39
39
  return `[${task.completed ? 'x' : ' '}] ${task.summary}` + children;
40
40
  }
@@ -111,7 +111,7 @@
111
111
  <Icon i="trash" />
112
112
  <span>{text('generic.delete')}</span>
113
113
  </div>
114
- {#if user.preferences.debug}
114
+ {#if user?.preferences?.debug}
115
115
  <div class="menu-item" onclick={() => copy('text/plain', task.id)}>
116
116
  <Icon i="hashtag" --size="14px" />
117
117
  <span>{text('tasks.copy_id')}</span>
@@ -232,7 +232,7 @@
232
232
  <span>{text('tasks.open_new_tab')}</span>
233
233
  </div>
234
234
  {/if}
235
- {#if user.preferences.debug}
235
+ {#if user?.preferences?.debug}
236
236
  <div class="menu-item" onclick={() => copy('text/plain', list.id)}>
237
237
  <Icon i="hashtag" --size="14px" />
238
238
  <span>{text('tasks.copy_id')}</span>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/tasks",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "author": "James Prevett <axium@jamespre.dev>",
5
5
  "description": "Tasks for Axium",
6
6
  "funding": {