File tree Expand file tree Collapse file tree 4 files changed +10
-9
lines changed
backend/electron/renderer Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -36,12 +36,9 @@ const unwrapApi = (baseApi: SandboxWithTransferableResult): Sandbox =>
36
36
value ( ...args ) ;
37
37
38
38
if ( result instanceof Promise ) {
39
- return result . then ( ( res ) =>
40
- // @ts -expect-error 動いているので無視
41
- getOrThrowTransferableResult ( res ) ,
42
- ) ;
43
- } else {
44
39
// @ts -expect-error 動いているので無視
40
+ return result . then ( ( res ) => getOrThrowTransferableResult ( res ) ) ;
41
+ } else {
45
42
return getOrThrowTransferableResult ( result ) ;
46
43
}
47
44
} ;
Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ const api: Sandbox = {
219
219
} ,
220
220
221
221
/** webUtils.getPathForFileを呼ぶ */
222
- getPathForFile : ( file ) => {
222
+ getPathForFile : async ( file ) => {
223
223
return webUtils . getPathForFile ( file ) ;
224
224
} ,
225
225
} ;
Original file line number Diff line number Diff line change @@ -618,12 +618,16 @@ watch(
618
618
619
619
// ファイルのドロップ
620
620
const fileDropEventCounter = ref (0 );
621
- const loadDroppedFile = (event : { dataTransfer: DataTransfer | null }) => {
621
+ const loadDroppedFile = async (event : {
622
+ dataTransfer: DataTransfer | null ;
623
+ }) => {
622
624
if (! event .dataTransfer || event .dataTransfer .files .length === 0 ) return ;
623
625
const file = event .dataTransfer .files [0 ];
624
626
625
627
// electronの場合のみファイルパスを取得できる
626
- const filePath = isElectron ? window .backend .getPathForFile (file ) : undefined ;
628
+ const filePath = isElectron
629
+ ? await window .backend .getPathForFile (file )
630
+ : undefined ;
627
631
628
632
switch (path .extname (file .name )) {
629
633
case " .txt" :
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ export interface Sandbox {
134
134
uninstallVvppEngine ( engineId : EngineId ) : Promise < void > ;
135
135
validateEngineDir ( engineDir : string ) : Promise < EngineDirValidationResult > ;
136
136
reloadApp ( obj : { isMultiEngineOffMode ?: boolean } ) : Promise < void > ;
137
- getPathForFile ( file : File ) : string ;
137
+ getPathForFile ( file : File ) : Promise < string > ;
138
138
}
139
139
140
140
export type AppInfos = {
You can’t perform that action at this time.
0 commit comments