add encrypted Nostr session sharing (#8922)

Signed-off-by: callebtc <93376500+callebtc@users.noreply.github.com>
Signed-off-by: Douwe Osinga <douwe@squareup.com>
Signed-off-by: Michael Neale <michael.neale@gmail.com>
Co-authored-by: Douwe Osinga <douwe@squareup.com>
Co-authored-by: Michael Neale <michael.neale@gmail.com>
This commit is contained in:
callebtc
2026-05-12 22:06:44 -05:00
committed by GitHub
parent 8c36ba86c6
commit dbbee1cdbf
17 changed files with 1469 additions and 27 deletions
+18 -9
View File
@@ -8,7 +8,7 @@ import {
useLocation,
useSearchParams,
} from 'react-router-dom';
import { openSharedSessionFromDeepLink } from './sessionLinks';
import { openSharedSessionFromDeepLink, importNostrSessionFromDeepLink } from './sessionLinks';
import { type SharedSessionDetails } from './sharedSessions';
import { ErrorUI } from './components/ErrorBoundary';
import { ExtensionInstallModal } from './components/ExtensionInstallModal';
@@ -428,6 +428,11 @@ export function AppInner() {
setIsLoadingSharedSession(true);
setSharedSessionError(null);
try {
if (link.startsWith('goose://sessions/nostr')) {
await importNostrSessionFromDeepLink(link);
navigate('/sessions');
return;
}
await openSharedSessionFromDeepLink(link, (_view: View, options?: ViewOptions) => {
navigate('/shared-session', { state: options });
});
@@ -438,14 +443,18 @@ export function AppInner() {
action: 'open_shared_session',
recoverable: true,
});
// Navigate to shared session view with error
const shareToken = link.replace('goose://sessions/', '');
const options = {
sessionDetails: null,
error: errorMessage(error, 'Unknown error'),
shareToken,
};
navigate('/shared-session', { state: options });
if (link.startsWith('goose://sessions/nostr')) {
toast.error(`Failed to import Nostr session: ${errorMessage(error, 'Unknown error')}`);
navigate('/sessions');
} else {
const shareToken = link.replace('goose://sessions/', '');
const options = {
sessionDetails: null,
error: errorMessage(error, 'Unknown error'),
shareToken,
};
navigate('/shared-session', { state: options });
}
} finally {
setIsLoadingSharedSession(false);
}