mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-30 01:27:26 +08:00
1 parent
1c576bde18
commit
1de949abfc
8 files changed
+215
-23
No files matched your search
@@ -726,6 +726,13 @@ class NativeHost {
|
||||
}
|
||||
|
||||
async start(onFiles, onError) {
|
||||
let launching = Promise.resolve();
|
||||
this.bridge.on("ofdgo.launch", values => {
|
||||
launching = launching.then(async () => {
|
||||
try { await onFiles(values.map(value => new NativeFile(value)), true); }
|
||||
finally { await this.call("launch.done", {}); }
|
||||
}).catch(onError);
|
||||
});
|
||||
this.bridge.on("ofdgo.files", async values => {
|
||||
try { await onFiles(values.map(value => new NativeFile(value))); }
|
||||
catch (error) { onError(error); }
|
||||
|
||||
Reference in new issue
Block a user