fix: macosx UI cleanup

This commit is contained in:
2026-02-19 22:50:21 +01:00
parent 7e593b587b
commit 0d66939eb7
8 changed files with 333 additions and 176 deletions

View File

@@ -288,6 +288,25 @@ const App: React.FC = () => {
}) || (() => {})
);
unsubscribers.push(
window.electronAPI?.on('menu:previewPost', async () => {
try {
const selectedPostId = useAppStore.getState().selectedPostId;
if (!selectedPostId) {
return;
}
const previewUrl = await window.electronAPI?.posts.getPreviewUrl(selectedPostId);
if (typeof previewUrl === 'string' && previewUrl.length > 0) {
window.open(previewUrl, '_blank', 'noopener');
}
} catch (error) {
console.error('Failed to open selected post preview:', error);
showToast.error('Failed to open selected post preview');
}
}) || (() => {})
);
unsubscribers.push(
window.electronAPI?.on('menu:openDocumentation', () => {
openTab({ id: 'documentation', type: 'documentation', isTransient: false });