Skip to content

Commit

Permalink
Fix typings for successful build
Browse files Browse the repository at this point in the history
  • Loading branch information
notmike101 committed Jul 28, 2023
1 parent ca57509 commit 3e31dc6
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions packages/renderer/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import ErrorMessage from './components/ErrorMessage.vue';
import PackButton from './components/PackButton.vue';
import type ElectronStore from 'electron-store';
import type { IpcRendererEvent } from 'electron/common';
import type { IPackOptions, CameraPosition } from 'types';
const store = new Store() as ElectronStore<IPackOptions>;
Expand Down Expand Up @@ -119,26 +120,26 @@ const updateCameraPosition = (event: CameraPosition) => {
cameraPosition.value = event;
};
const onPackSuccess = (event: Event, data: any) => {
const onPackSuccess = (event: IpcRendererEvent, data: any) => {
isProcessing.value = false;
outputFile.value = data.file;
outputFileSize.value = data.file.binary.byteLength;
addLog('Packing successful. Reduced file size by ' + (100 - (outputFileSize.value / inputFileSize.value) * 100).toFixed(2) + '%.');
};
const onPackError = (event: Event, data: any) => {
const onPackError = (event: IpcRendererEvent, data: any) => {
errorMessage.value = data.error.message;
isProcessing.value = false;
addLog('Error: ' + data.error.message);
};
const onPackSizeReport = (event: Event, data: any) => {
const onPackSizeReport = (event: IpcRendererEvent, data: any) => {
addLog(`Action ${data.action} reduced file size by ${(100 - (data.endSize / data.startSize) * 100).toFixed(2)}%.`);
};
const onLoggingEvent = (event: Event, data: any) => {
const onLoggingEvent = (event: IpcRendererEvent, data: any) => {
addLog(`[${data.verbosity}] ${data.text}`);
};
Expand Down Expand Up @@ -180,17 +181,17 @@ ipcRenderer.on('pack-sizereport', onPackSizeReport);
</script>

<template>
<div @drop="drop" @dragover="dragover" class="flex flex-col flex-1 select-none overflow-hidden flex-wrap">
<div @drop="drop" @dragover="dragover" class="flex flex-col flex-wrap flex-1 overflow-hidden select-none">
<TitleBar />
<div class="flex flex-row flex-1 select-none overflow-hidden flex-wrap">
<div class="flex flex-row flex-wrap flex-1 overflow-hidden select-none">
<aside v-if="inputFile" class="basis-[250px] bg-[#ecf0f1] break-words text-left flex flex-col p-0 max-h-full">
<Tabs />
<div class="mb-auto flex flex-col">
<div class="flex flex-col mb-auto">
<component :is="tabMap[activeTab]" />
</div>
<PackButton :isProcessing="isProcessing" @click="doPack" />
</aside>
<main v-if="inputFile" class="flex flex-row flex-1 overflow-hidden max-h-full">
<main v-if="inputFile" class="flex flex-row flex-1 max-h-full overflow-hidden">
<div class="flex flex-col flex-1">
<div class="flex flex-row flex-1 overflow-hidden">
<div class="flex flex-1 flex-col relative overflow-hidden max-w-full max-h-full first-of-type:border-r first-of-type:border-r-[#bdc3c7]">
Expand All @@ -203,7 +204,7 @@ ipcRenderer.on('pack-sizereport', onPackSizeReport);
<FileInfo :name="outputFile.name" :size="outputFileSize" />
</template>
<template v-if="isProcessing === true">
<p class="m-auto flex flex-1 items-center justify-center">Processing...</p>
<p class="flex items-center justify-center flex-1 m-auto">Processing...</p>
</template>
</div>
</div>
Expand Down

0 comments on commit 3e31dc6

Please sign in to comment.