Skip to content

Commit

Permalink
Use normalized paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsEeleeya committed Oct 18, 2024
1 parent f562ae8 commit 3904c8c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export default function Recordings() {
};

const handleOpenEditor = (id: string) => {
const fileName = id.split("/").pop() || "";
const normalizedPath = id.replace(/\\/g, "/");
const fileName = normalizedPath.split("/").pop() || "";
commands.openEditor(fileName.replace(".cap", ""));
};

Expand Down
7 changes: 4 additions & 3 deletions apps/desktop/src/routes/prev-recordings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,14 @@ export default function () {
<For each={allMedia()}>
{(media) => {
const [ref, setRef] = createSignal<HTMLElement | null>(null);
console.log(media);
const mediaId = media.path.split("/").pop()?.split(".")[0]!;
const normalizedPath = media.path.replace(/\\/g, "/");
const mediaId = normalizedPath.split("/").pop()?.split(".")[0]!;

const type = media.type ?? "recording";
const fileId =
type === "recording"
? mediaId
: media.path
: normalizedPath
.split("screenshots/")[1]
.split("/")[0]
.replace(".cap", "");
Expand Down
1 change: 1 addition & 0 deletions crates/media/src/platform/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ pub fn bring_window_to_focus(window_id: u32) {

/// Keeps handles to default cursor.
/// Read more: [MS Doc - About Cursors](https://learn.microsoft.com/en-us/windows/win32/menurc/about-cursors)
// TODO(Ilya): Change to an enum and define the values here.
pub struct DefaultCursors {
arrow: isize,
ibeam: isize,
Expand Down

0 comments on commit 3904c8c

Please sign in to comment.