feat(share): after sharing, send the entry on as task or list item with one tap
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m30s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m30s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3d367ce633
commit
da258fdce2
7 files changed
+200
-9
No files matched your search
+27
-3
@@ -56,6 +56,7 @@ import { WorkspaceView } from './features/workspace/WorkspaceView';
|
||||
import { SharedListsView } from './features/lists/SharedListsView';
|
||||
import { SetupAndAuthView } from './features/auth/SetupAndAuthView';
|
||||
import { OfflineBanner } from './components/OfflineBanner';
|
||||
import { SharedImportToast } from './components/SharedImportToast';
|
||||
import { outboxCount, clearOfflineData } from './lib/offline';
|
||||
import { DemoCountdown } from './components/DemoCountdown';
|
||||
import { UserSettingsView } from './features/settings/UserSettingsView';
|
||||
@@ -136,6 +137,9 @@ export const App: React.FC = () => {
|
||||
const [demoDeadline, setDemoDeadline] = useState<number | null>(null);
|
||||
const [dataEpoch, setDataEpoch] = useState(0);
|
||||
const [demoNotice, setDemoNotice] = useState<string | null>(null);
|
||||
// Just shared from another app: these Quick Dump entries can still be sent on as task / list item
|
||||
const [sharedImportIds, setSharedImportIds] = useState<string[] | null>(null);
|
||||
const closeSharedImport = useCallback(() => setSharedImportIds(null), []);
|
||||
const lastDemoResetRef = useRef(0);
|
||||
const handleDemoResetRef = useRef<() => void>(() => {});
|
||||
// Link from the password reset mail (?resetToken=…); removed from the address bar right away
|
||||
@@ -601,18 +605,25 @@ export const App: React.FC = () => {
|
||||
if (shares.length === 0) return;
|
||||
|
||||
let importedCount = 0;
|
||||
const ids: string[] = [];
|
||||
for (const share of shares) {
|
||||
const content = formatSharedThought(share);
|
||||
if (content) {
|
||||
await api.captureThought(content, 'normal', 'manual', '', { target: 'inbox' });
|
||||
const created = await api.captureThought(content, 'normal', 'manual', '', { target: 'inbox' });
|
||||
importedCount++;
|
||||
if (created?.id && !created.id.startsWith('th_offline_')) ids.push(created.id);
|
||||
}
|
||||
}
|
||||
|
||||
if (importedCount > 0) {
|
||||
triggerHaptic(15);
|
||||
setDemoNotice('Erfolgreich im Quick Dump abgelegt');
|
||||
setTimeout(() => setDemoNotice(null), 4000);
|
||||
if (ids.length === importedCount) {
|
||||
setSharedImportIds(ids);
|
||||
} else {
|
||||
// Offline: kept for later, nothing to convert yet
|
||||
setDemoNotice('Im Quick Dump abgelegt');
|
||||
setTimeout(() => setDemoNotice(null), 4000);
|
||||
}
|
||||
refreshAll();
|
||||
}
|
||||
} catch (err) {
|
||||
@@ -1184,6 +1195,19 @@ export const App: React.FC = () => {
|
||||
|
||||
<MobileHeaderMenu activeTabLabel={activeTabLabelMap[activeTab]} />
|
||||
<OfflineBanner />
|
||||
{sharedImportIds && (
|
||||
<SharedImportToast
|
||||
thoughtIds={sharedImportIds}
|
||||
lists={lists}
|
||||
onClose={closeSharedImport}
|
||||
onConverted={(message) => {
|
||||
setSharedImportIds(null);
|
||||
setDemoNotice(message);
|
||||
setTimeout(() => setDemoNotice(null), 3000);
|
||||
refreshAll();
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{demoNotice && (
|
||||
<div
|
||||
role="status"
|
||||
|
||||
Reference in new issue
Block a user