alpha
Login
or
Join now
tokono.ma
/
diffuse-applets
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Experiment to rebuild Diffuse using web applets.
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
fix: output configuration
author
Steven Vandevelde
date
1 year ago
(Jun 1, 2025, 3:28 PM +0200)
commit
2c830d51
2c830d51e46541080aafb20f2f6bbf3778af3f5a
parent
1573c9b0
1573c9b0c43c219fac853543ccc783bee82b25ce
+19
-9
4 changed files
Expand all
Collapse all
Unified
Split
src
components
List.astro
pages
configurator
output
_applet.astro
index.astro
output
native-fs
_applet.astro
+1
-1
src/components/List.astro
Reviewed
···
6
6
{
7
7
items.map((item: { title: string; url: string }) => (
8
8
<li>
9
9
-
{item.title.startsWith("(TODO) ") || item.title.startsWith("(WIP) ") ? (
9
9
+
{item.title.startsWith("(TODO) ") ? (
10
10
<span>{item.title}</span>
11
11
) : (
12
12
<a href={item.url}>{item.title}</a>
+9
-2
src/pages/configurator/output/_applet.astro
Reviewed
···
126
126
break;
127
127
default:
128
128
const conn = await connection(method);
129
129
-
await conn.sendAction("mount");
130
130
-
setActive(method);
129
129
+
try {
130
130
+
await conn.sendAction("mount");
131
131
+
setActive(method);
132
132
+
} catch (err) {
133
133
+
const msg: string =
134
134
+
err && typeof err === "object" && "message" in err ? `${err.message}` : `${err}`;
135
135
+
if (msg.startsWith("[user] ")) alert(msg.slice(7));
136
136
+
}
137
137
+
break;
131
138
}
132
139
}
133
140
+1
-1
src/pages/index.astro
Reviewed
···
47
47
const output = [
48
48
{ url: "output/indexed-db/", title: "IndexedDB" },
49
49
{ url: "output/native-fs/", title: "Native File System" },
50
50
-
{ url: "output/storacha-automerge", title: "Storacha Storage + Automerge CRDT" },
50
50
+
{ url: "output/storacha-automerge/", title: "(WIP) Storacha Storage + Automerge CRDT" },
51
51
{ url: "output/todo/", title: "(TODO) Keyhive/Beelay" },
52
52
{ url: "output/todo/", title: "(TODO) Dialog DB" },
53
53
];
+8
-5
src/pages/output/native-fs/_applet.astro
Reviewed
···
1
1
<script>
2
2
import * as IDB from "idb-keyval";
3
3
-
import "wicg-file-system-access";
3
3
+
import type * as FSA from "wicg-file-system-access";
4
4
5
5
import type { ManagedOutput, Track } from "@applets/core/types";
6
6
import { jsonDecode, jsonEncode, register } from "@scripts/applets/common";
···
16
16
context.data = INITIAL_MANAGED_OUTPUT;
17
17
18
18
// Load initial data
19
19
-
if (context.isMainInstance())
20
20
-
tracks().then((collection) => {
19
19
+
if (context.isMainInstance() && (await IDB.get(IDB_DEVICE_KEY))) loadInitialData();
20
20
+
21
21
+
async function loadInitialData() {
22
22
+
return tracks().then((collection) => {
21
23
context.data = {
22
24
...context.data,
23
25
tracks: {
···
28
30
},
29
31
};
30
32
});
33
33
+
}
31
34
32
35
////////////////////////////////////////////
33
36
// ACTIONS
···
48
51
49
52
async function mount() {
50
53
if (!("showDirectoryPicker" in self)) {
51
51
-
alert("File System Access API is not supported on this platform.");
52
52
-
return;
54
54
+
throw new Error("[user] The File System Access API is not supported on this platform.");
53
55
}
54
56
55
57
const existingHandle = await IDB.get(IDB_DEVICE_KEY);
···
57
59
const directoryHandle = await self.showDirectoryPicker();
58
60
await IDB.set(IDB_DEVICE_KEY, directoryHandle);
59
61
await directoryHandle.requestPermission({ mode: "readwrite" });
62
62
+
loadInitialData();
60
63
}
61
64
}
62
65