Skip to content

Commit

Permalink
Normalizing file path when getting native file icon
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschwendener committed Nov 22, 2018
1 parent 373df86 commit 0dc740a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ts/production-icon-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import { NativeImage } from "electron";
import { SearchResultItem } from "./search-result-item";
import { IconSet } from "./icon-sets/icon-set";
import { app } from "electron";
import { normalize } from "path";

export class ProductionIconService {
public getProgramIcon(iconSet: IconSet, searchResultItem: SearchResultItem ): Promise<SearchResultItem> {
return new Promise((resolve, reject) => {
if (searchResultItem.icon === iconSet.appIcon || searchResultItem.icon === iconSet.fileIcon) {
app.getFileIcon(searchResultItem.executionArgument, { size: "normal" }, (error: Error, icon: NativeImage) => {
app.getFileIcon(normalize(searchResultItem.executionArgument), { size: "normal" }, (error: Error, icon: NativeImage) => {
if (error) {
resolve(searchResultItem);
} else {
Expand Down

0 comments on commit 0dc740a

Please sign in to comment.