-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better flows around setting up FS sync and Git
- Loading branch information
Showing
20 changed files
with
499 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { SettingsTab } from '../components/Settings/SettingsTab'; | ||
import { getActiveWorkspaceId } from '../hooks/useActiveWorkspace'; | ||
import { createFastMutation } from '../hooks/useFastMutation'; | ||
import { trackEvent } from '../lib/analytics'; | ||
import { router } from '../lib/router'; | ||
import { invokeCmd } from '../lib/tauri'; | ||
|
||
export const openSettings = createFastMutation<void, string, SettingsTab | null>({ | ||
mutationKey: ['open_settings'], | ||
mutationFn: async function (tab) { | ||
const workspaceId = getActiveWorkspaceId(); | ||
if (workspaceId == null) return; | ||
|
||
trackEvent('dialog', 'show', { id: 'settings', tab: `${tab}` }); | ||
const location = router.buildLocation({ | ||
to: '/workspaces/$workspaceId/settings', | ||
params: { workspaceId }, | ||
search: { tab: tab ?? SettingsTab.General }, | ||
}); | ||
await invokeCmd('cmd_new_child_window', { | ||
url: location.href, | ||
label: 'settings', | ||
title: 'Yaak Settings', | ||
innerSize: [750, 600], | ||
}); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { WorkspaceSettingsDialog } from '../components/WorkspaceSettingsDialog'; | ||
import { getActiveWorkspaceId } from '../hooks/useActiveWorkspace'; | ||
import { createFastMutation } from '../hooks/useFastMutation'; | ||
import { showDialog } from '../lib/dialog'; | ||
|
||
export const openWorkspaceSettings = createFastMutation<void, string, { openSyncMenu?: boolean }>({ | ||
mutationKey: ['open_workspace_settings'], | ||
async mutationFn({ openSyncMenu }) { | ||
const workspaceId = getActiveWorkspaceId(); | ||
showDialog({ | ||
id: 'workspace-settings', | ||
title: 'Workspace Settings', | ||
size: 'md', | ||
render({ hide }) { | ||
return ( | ||
<WorkspaceSettingsDialog | ||
workspaceId={workspaceId} | ||
hide={hide} | ||
openSyncMenu={openSyncMenu} | ||
/> | ||
); | ||
}, | ||
}); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.