Skip to content

Commit

Permalink
fix(snackbar): response for annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
con-cis committed Jul 21, 2024
1 parent 4d52cc7 commit 65c0364
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/renderer/src/components/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const props = defineProps({
},
resetChannels: {
type: Boolean,
default: true
default: undefined
}
})
Expand Down Expand Up @@ -85,8 +85,8 @@ const saveAnnotation = (): void => {
window.api.onSetAnnotation({ channelId: selectedChannel.value?.id ?? "", annotation: selectedChannel.value?.annotation ?? "" })
.then((result) => {
result === ApiResponses.RESOLVED_SUCCESSFULLY ?
wasSuccessful.value = true :
hasErrorsAnnotation.value = true
(wasSuccessful.value = true, isResetAction.value = false) :
(hasErrorsAnnotation.value = true, isResetAction.value = false)
})
};
Expand Down
21 changes: 15 additions & 6 deletions src/renderer/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
/// <reference types="vite/client" />
import { ElectronAPI } from '@electron-toolkit/preload'
import ApiResponses from 'src/enums/ApiResponses'
import { ConfigData } from 'src/types/ConfigData'

declare module '*.vue' {
import type { DefineComponent } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any>
export default component
declare global {
interface Window {
electron: ElectronAPI
api: {
onGetConfig: (callback: (event: Electron.IpcRendererEvent, data: ConfigData) => void) => void
onOpenFileDialog: () => Promise<ApiResponses>
onSaveFileDialog: () => Promise<ApiResponses>
onSetAnnotation: (data: { channelId: string; annotation: string }) => Promise<ApiResponses>
resetData: () => Promise<ApiResponses>
// Add other properties and methods as needed
}
}
}

0 comments on commit 65c0364

Please sign in to comment.