Skip to content

Commit

Permalink
fix: dont destructure electronApi in store
Browse files Browse the repository at this point in the history
  • Loading branch information
mtdvlpr committed Dec 6, 2024
1 parent cae26c7 commit ea387e1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/stores/current-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import { getAdditionalMediaPath } from 'src/utils/fs';
import { isEmpty, isUUID } from 'src/utils/general';
import { formatTime } from 'src/utils/time';

const { fs, path } = window.electronApi;

interface Songbook {
fileformat: 'MP3' | 'MP4';
pub: 'sjj' | 'sjjm';
Expand Down Expand Up @@ -71,12 +69,12 @@ export const useCurrentStateStore = defineStore('current-state', {
this.currentSettings?.cacheFolder,
);
const dateString = formatDate(new Date(destDate), 'YYYYMMDD');
const datedAdditionalMediaDirectory = path.join(
const datedAdditionalMediaDirectory = window.electronApi.path.join(
additionalMediaPath,
this.currentCongregation,
dateString,
);
await fs.ensureDir(datedAdditionalMediaDirectory);
await window.electronApi.fs.ensureDir(datedAdditionalMediaDirectory);
return datedAdditionalMediaDirectory;
} catch (error) {
errorCatcher(error);
Expand Down

0 comments on commit ea387e1

Please sign in to comment.