diff --git a/src/components/subscribe.js b/src/components/subscribe.js index c6dd19a..f02b261 100644 --- a/src/components/subscribe.js +++ b/src/components/subscribe.js @@ -26,22 +26,22 @@ export class DialogSubscribe extends TonicDialog { const coInput = this.querySelector('#subscribe-shared-secret') const url = new URL(coInput.value.trim()) - const bundleId = url.searchParams.get('id') + const sharedSecret = url.searchParams.get('secret') - // union://foo?id=com.demo.project&org=test + // union://com.demo.project&secret=foo - if (!bundleId) { + if (!sharedSecret) { notifications.create({ type: 'error', title: 'Error', - message: 'Invalid Project Link: expected property "id".' + message: 'Invalid Project Link: expected property "secret".' }) super.hide() return } - const sharedSecret = url.hostname + const bundleId = url.hostname const clusterId = await sha256('union-app-studio', { bytes: true }) const sharedKey = await Encryption.createSharedKey(sharedSecret) const derivedKeys = await Encryption.createKeyPair(sharedKey) @@ -87,13 +87,13 @@ export class DialogSubscribe extends TonicDialog {

- Enter the unique link for the project you want to subscribe to. You will receive updates as "patch requests". + Enter the unique link for the project you want to subscribe to. It may take up to several minutes to acquire all updates. Future updates may arrive in the form of "patch requests".

+ + + + - - - - diff --git a/src/views/home.js b/src/views/home.js index e199718..e71c0a5 100644 --- a/src/views/home.js +++ b/src/views/home.js @@ -93,93 +93,87 @@ class ViewHome extends Tonic { return this.html`
+ + What's New + Docs + Profile +
-
-

Union App Studio

-
-
- - What's New - Docs - Profile - - - -
- Content One -
-
- - -
- -
-
- - -
- - - -
- Regenerate Keys - -
- - - - -
-
-
+ +
+ No new items... +
+
+ + +
+ +
+
+ + +
+ + + +
+ Regenerate Keys + +
+ + + + +
+
` } diff --git a/src/views/project-summary.js b/src/views/project-summary.js index aeab497..62f2a40 100644 --- a/src/views/project-summary.js +++ b/src/views/project-summary.js @@ -23,6 +23,23 @@ class ViewProjectSummary extends Tonic { const { event } = el.dataset + if (event === 'project-path') { + const dirHandle = await window.showDirectoryPicker({}) + if (!dirHandle) return + + console.log(dirHandle) + + const app = this.props.parent + const currentProject = app.state.currentProject + + const editor = document.querySelector('app-editor') + const project = document.querySelector('app-project') + + const { data: dataProject } = await app.db.projects.get(currentProject.projectId) + + // TODO(@heapwolf): set the path on the project object and refresh the project and editor components. + } + if (event === 'publish') { const coDialogPublish = document.querySelector('dialog-publish') if (coDialogPublish) coDialogPublish.show() @@ -107,7 +124,7 @@ class ViewProjectSummary extends Tonic { position="right" spellcheck="false" readonly="true" - value="union://${dataProject.sharedSecret}?id=${encodeURIComponent(dataProject.bundleId)}&org=${dataProject.org}" + value="union://${encodeURIComponent(dataProject.bundleId)}?secret=${dataProject.sharedSecret}" >