mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-01 03:02:28 +03:00
This commit is contained in:
parent
c2e43ac66a
commit
be65f04db7
5
.changes/invoke-context.md
Normal file
5
.changes/invoke-context.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": patch
|
||||
---
|
||||
|
||||
Allow `window.__TAURI__.invoke` to be moved to another variable.
|
2
.github/workflows/test-core.yml
vendored
2
.github/workflows/test-core.yml
vendored
@ -10,7 +10,7 @@ on:
|
||||
- '.github/workflows/test-core.yml'
|
||||
- 'core/**'
|
||||
- 'examples/**'
|
||||
- 'cli/**'
|
||||
- 'tooling/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
|
@ -93,14 +93,12 @@ if (!String.prototype.startsWith) {
|
||||
};
|
||||
|
||||
window.__TAURI__.invoke = function invoke(cmd, args = {}) {
|
||||
var _this = this;
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
var callback = _this.transformCallback(function (r) {
|
||||
var callback = window.__TAURI__.transformCallback(function (r) {
|
||||
resolve(r);
|
||||
delete window[error];
|
||||
}, true);
|
||||
var error = _this.transformCallback(function (e) {
|
||||
var error = window.__TAURI__.transformCallback(function (e) {
|
||||
reject(e);
|
||||
delete window[callback];
|
||||
}, true);
|
||||
|
@ -42,5 +42,6 @@ module.exports = {
|
||||
transform: {
|
||||
'\\.toml$': 'jest-transform-toml',
|
||||
'\\.(js|ts)$': 'babel-jest'
|
||||
}
|
||||
},
|
||||
transformIgnorePatterns: ['node_modules/(?!(is-png|imagemin|p-pipe)/)']
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user