Fix types

This commit is contained in:
Pierre Jacquier
2024-02-15 07:08:07 -05:00
parent 4f2cf2954a
commit 1ffb6b0192
8 changed files with 17 additions and 12 deletions

View File

@ -205,7 +205,8 @@ fn main() {
{
_app.get_webview("main").unwrap().open_devtools();
}
_app.handle().plugin(tauri_plugin_updater::Builder::new().build())?;
_app.handle()
.plugin(tauri_plugin_updater::Builder::new().build())?;
Ok(())
})
.invoke_handler(tauri::generate_handler![

View File

@ -218,7 +218,7 @@ export const Toolbar = () => {
onClick={() => commandBarSend({ type: 'Open' })}
className="rounded-r-full pr-4 self-stretch border-energy-10 hover:border-energy-10 dark:border-chalkboard-80 bg-energy-10/50 hover:bg-energy-10 dark:bg-chalkboard-80 dark:text-energy-10"
>
{platform === 'darwin' ? '⌘K' : 'Ctrl+/'}
{platform === 'macos' ? '⌘K' : 'Ctrl+/'}
</ActionButton>
</div>
)

View File

@ -54,7 +54,7 @@ export const AppHeader = ({
>
Command Palette{' '}
<kbd className="bg-energy-10/50 dark:bg-chalkboard-100 dark:text-energy-10 inline-block px-1 py-0.5 border-energy-10 dark:border-chalkboard-90">
{platform === 'darwin' ? '⌘K' : 'Ctrl+/'}
{platform === 'macos' ? '⌘K' : 'Ctrl+/'}
</kbd>
</ActionButton>
)}

View File

@ -120,7 +120,10 @@ function ProjectCard({
}`}
</span>
<span className="text-chalkboard-60 text-xs">
Edited {getDisplayedTime(project.entrypointMetadata.mtime)}
Edited{' '}
{project.entrypointMetadata.mtime
? getDisplayedTime(project.entrypointMetadata.mtime)
: 'never'}
</span>
<div className="absolute z-10 bottom-2 right-2 flex gap-1 items-center opacity-0 group-hover:opacity-100 group-focus-within:opacity-100">
<ActionButton

View File

@ -17,23 +17,24 @@ const projectWellFormed = {
},
],
entrypointMetadata: {
accessedAt: now,
atime: now,
blksize: 32,
blocks: 32,
createdAt: now,
birthtime: now,
dev: 1,
gid: 1,
ino: 1,
isDir: false,
isDirectory: false,
isFile: true,
isSymlink: false,
mode: 1,
modifiedAt: now,
mtime: now,
nlink: 1,
permissions: { readonly: false, mode: 1 },
readonly: false,
rdev: 1,
size: 32,
uid: 1,
fileAttributes: null,
},
} satisfies ProjectWithEntryPointMetadata

View File

@ -45,7 +45,7 @@ const ProjectSidebarMenu = ({
<div className="flex flex-col items-start py-0.5">
<span className="hidden text-sm text-chalkboard-110 dark:text-chalkboard-20 whitespace-nowrap lg:block">
{isTauri() && file?.name
? file.name.slice(file.name.lastIndexOf(sep) + 1)
? file.name.slice(file.name.lastIndexOf(sep()) + 1)
: APP_NAME}
</span>
{isTauri() && project?.name && (

View File

@ -25,7 +25,7 @@ export async function exportSave(data: ArrayBuffer) {
}
// Write the file.
await writeFile(filePath, file.contents)
await writeFile(filePath, new Uint8Array(file.contents))
} else {
// Download the file to the user's computer.
// Now we need to download the files to the user's downloads folder.

View File

@ -22,7 +22,7 @@ export default function CmdK() {
<h2 className="text-2xl font-bold">Command Bar</h2>
<p className="my-4">
Press{' '}
{platformName === 'darwin' ? (
{platformName === 'macos' ? (
<>
<kbd></kbd> + <kbd>K</kbd>
</>