Skip to content

Commit

Permalink
refactor: remove unneeded wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
sehnryr committed Nov 8, 2024
1 parent b74a9d3 commit 37fd12c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 1 addition & 5 deletions src/services/extensions.service.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { convertFileSrc, invoke } from "@tauri-apps/api/core";
import { invoke } from "@tauri-apps/api/core";

import { Chapter } from "../types/chapter.ts";
import { Filter } from "../types/filter.ts";
import { Manga, MangaList } from "../types/manga.ts";
import { Page } from "../types/page.ts";

export function getIconUrl(iconPath: string): string {
return convertFileSrc(iconPath);
}

export async function getMangaList(
extensionId: string,
filters: Filter[],
Expand Down
5 changes: 2 additions & 3 deletions src/services/tauri.service.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { invoke } from "@tauri-apps/api/core";
import { convertFileSrc, invoke } from "@tauri-apps/api/core";

import { Extension, Source } from "../types/extension.ts";
import { Manifest } from "../types/manifest.ts";
import { getIconUrl } from "./extensions.service.ts";

export async function getExtensions(): Promise<Extension[]> {
return (await invoke<[string, Source, string][]>("get_extensions"))
.map(([id, source, iconPath]) =>
<Extension> {
id: id,
source: source,
iconUrl: getIconUrl(iconPath),
iconUrl: convertFileSrc(iconPath),
}
);
}
Expand Down

0 comments on commit 37fd12c

Please sign in to comment.