fix small quirks

This commit is contained in:
Andre Staltz 2024-01-31 14:42:19 +02:00
parent 4401cc3b8e
commit 53bde957df
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
4 changed files with 6 additions and 10 deletions

View File

@ -3,6 +3,6 @@
To develop: To develop:
1. `npm install` 1. `npm install`
2. `npm start` in one terminal, `npm run electron-dev` in another 2. `npm start` in one terminal, `npm run electron` in another
3. Edit JS code 3. Edit JS code
4. Sometimes you may need to re-run step 2 4. Sometimes you may need to re-run step 2

View File

@ -237,10 +237,9 @@ async function handlePPPPPUri(uri) {
return return
} }
if (!uri.startsWith('ppppp://')) return if (!uri.startsWith('ppppp://')) return
console.log('handlePPPPPUri', uri)
const commands = peer.invite.parse(uri) const commands = peer.invite.parse(uri)
for (const command of commands) { for (const command of commands) {
console.log(command) console.log('Executing command', JSON.stringify(command))
switch (command.type) { switch (command.type) {
case 'join': { case 'join': {
try { try {
@ -258,9 +257,7 @@ async function handlePPPPPUri(uri) {
case 'promise.follow': { case 'promise.follow': {
const [issuerType, issuerPubkey] = command.issuer const [issuerType, issuerPubkey] = command.issuer
if (issuerType !== 'pubkey') { if (issuerType !== 'pubkey') {
throw new Error( throw new Error(`Dont know how to claim a ${issuerType} promise`)
'dont know how to claim promise issued by ' + issuerType
)
} }
// eslint-disable-next-line no-loop-func // eslint-disable-next-line no-loop-func
peer.addListener('rpc:connect', function onConnect(rpc) { peer.addListener('rpc:connect', function onConnect(rpc) {

View File

@ -5,12 +5,11 @@
"main": "main.js", "main": "main.js",
"homepage": "./", "homepage": "./",
"scripts": { "scripts": {
"start": "react-scripts start", "start": "BROWSER=none react-scripts start",
"build": "react-scripts build", "build": "react-scripts build",
"test": "react-scripts test", "test": "react-scripts test",
"eject": "react-scripts eject", "eject": "react-scripts eject",
"electron": "electron .", "electron": "ELECTRON_START_URL=http://localhost:3000 DEBUG=*,-shse,-pull-secretstream electron ."
"electron-dev": "ELECTRON_START_URL=http://localhost:3000 electron ."
}, },
"dependencies": { "dependencies": {
"@excalidraw/excalidraw": "0.17.2", "@excalidraw/excalidraw": "0.17.2",

View File

@ -11,7 +11,7 @@ let sceneInitialized = false
function App() { function App() {
const [excalidrawAPI, setExcalidrawAPI] = useState(null) const [excalidrawAPI, setExcalidrawAPI] = useState(null)
const [inviteModalOpen, setInviteModalOpen] = useState(true) const [inviteModalOpen, setInviteModalOpen] = useState(false)
const [inviteCode, setInviteCode] = useState(null) const [inviteCode, setInviteCode] = useState(null)
const openInviteModal = () => setInviteModalOpen(true) const openInviteModal = () => setInviteModalOpen(true)
const closeInviteModal = () => setInviteModalOpen(false) const closeInviteModal = () => setInviteModalOpen(false)